Vraag : Vind siblings en ouderknopen in DOM

Hallo, hebbend deze code, wat al knopenReeks vinden, druk zou ik wat in deze elementenReeks willen drukken is, en ook een andere sibling knoop die shos het element van het Begin dat me de tijd de reeks zal vertellen bij een verschillend kanaal…

=============================TVGuide.xml================================
< beginnen? xml version= " 1.0 " encoding= " ISO-8859-1 "? >


BBC1

2001-07-05T19: 00: 00
PT30M
QuestionOfSporteries>
<br/> </Program><br/> <Program rating= " 5 " flag= " favoriete " ><br/> <Start>2001-07-05T19: 30: de schrik van de 00<wbr/></Start><br/> <Duration>PT30M</Duration><wbr/><br/> <Series>EastEnders</Series<wbr/>><br/> <Title/><br/> <Description>Mark gezondheid dwingt hem om zijn toekomst met Lisa opnieuw in overweging te nemen, terwijl Jamie tussen <Name>Emma van Sonia en van <Name>Sonia Jackson</Name><br/> </Character><br/> <Actor><br/> <Name>Natalie Cassidy</Name><br/> </Actor><br/> </CastMember><br/> </CastList><br/> <Writers><br/> <Writer><br/> <Name>Nick Saltrese</Name><br/> </Writer><br/> <Writer><br/> <Name>Julie Wassmer</Name><br/> </Writer><br/> </Writers><br/> <Director><br/> <Name>Stewart Edwards</Name><br/> </Director><br van Zoe.</Description><br/> <CastList><br/> <CastMember><br/> <Character><br/> <Name>Zoe Slater</Name><br/> </Character><br/> <Actor><br/> <Name>Michelle Ryan</Name><br/> </Actor><br/> </CastMember><br/> <CastMember><br/> <Character><br/> <Name>Jamie Mitchell</Name><br/> </Character><br/> <Actor><br/> <Name>Jack Ryder</Name><br/> </Actor><br/> </CastMember><br/> <CastMember><br/> <Character><br/>/> <Producer><br/> Turner</Name><br/> wordt gescheurd                  </Producer><br/> </Program><br/> <Program type= " documentaire " ><br/> <Start>2001-07-05T20: 00: 00<wbr/></Start><br/> <Duration>PT45M</Duration><wbr/><br/> <Series/><br/> <Title>Get Echt met Casualty


2001-07-05T20: 45: 00
PT45M
Lottery
<br/> </Program><br/> <Program><br/> <Start>2001-07-05T21: 00: 00<wbr/></Start><br/> <Duration>PT1H</Duration><br/> <Series>Panorama</Series><br/> <Title/><br/> </Program><br/> <Program><br/> <Start>2001-07-05T22: 00: 00<wbr/></Start><br/> <Duration>PT45M</Duration><wbr/><br/> <Series>Lottery</Series><br/> <Title/><br/> </Program><br/> </Channel><br/> <Channel><br/> <Name>BBC2</Name><br/> <Program><br/> <Start>2001-07-05T19: 00: 00<wbr/></Start><br/> <Duration>PT1H</Duration><br/> <Series>Snooker</Series><br/> <Title/><br/> </Program><br/> <Program><br/> <Start>2001-07-05T20: 00: 00<wbr/></Start><br/> <Duration>PT1H</Duration><br/> <Series>HomeFront</Series><wbr/><br/> <Title/><br/> </Program><br/> <Program><br/> <Start>2001-07-05T21: 00: 00<wbr/></Start><br/> <Duration>PT50M</Duration><wbr/><br/> <Series>WildAfrica</Series<wbr/>><br/> <Title/><br/> </Program><br/> <Program flag= " het interesseren " ><br/> <Start>2001-07-05T21: 50: 00<wbr/></Start><br/> <Duration>PT40M</Duration><wbr/><br/> <Series>Taboo</Series><br/> <Title>Nakedness


2001-07-05T22: 30: 00
PT45M
Lottery
<br/> </Program><br/> </Channel><br/> <Channel><br/> <Name>ITV</Name><br/> <Program><br/> <Start>2001-07-05T19: 00: 00<wbr/></Start><br/> <Duration>PT30M</Duration><wbr/><br/> <Series>Emmerdale</Series><wbr/><br/> <Title/><br/> </Program><br/> <Program><br/> <Start>2001-07-05T19: 30: 00<wbr/></Start><br/> <Duration>PT30M</Duration><wbr/><br/> <Series>CoronationStreet</<wbr/>Series><br/> <Title/><br/> </Program><br/> <Program><br/> <Start>2001-07-05T20: 00: 00<wbr/></Start><br/> <Duration>PT1H</Duration><br/> <Series>Millionaire</Serie<wbr/>s><br/> <Title/><br/> </Program><br/> <Program type= " drama " ><br/> <Start>2001-07-05T21: 00: 00<wbr/></Start><br/> <Duration>PT2H</Duration><br/> <Series/><br/> <Title>Hot Money



Channel 4

2001-07-05T19: 00: 00
PT55M
Channel4Newses>
<br/> </Program><br/> <Program><br/> <Start>2001-07-05T19: 55: 00<wbr/></Start><br/> <Duration>PT5M</Duration><br/> <Series>SlotArt</Series><br/> <Title/><br/> </Program><br/> <Program><br/> <Start>2001-07-05T20: 00: 00<wbr/></Start><br/> <Duration>PT30M</Duration><wbr/><br/> <Series>Brookside</Series><wbr/><br/> <Title/><br/> </Program><br/> <Program><br/> <Start>2001-07-05T20: 30: 00<wbr/></Start><br/> <Duration>PT30M</Duration><wbr/><br/> <Series>Brookside</Series><wbr/><br/> <Title/><br/> </Program><br/> <Program><br/> <Start>2001-07-05T21: 00: 00<wbr/></Start><br/> <Duration>PT1H</Duration><br/> <Series>Swallow</Series><br/> <Title/><br/> </Program><br/> <Program flag= " favoriete " ><br/> <Start>2001-07-05T22: 00: 00<wbr/></Start><br/> <Duration>PT1H</Duration><br/> <Series>AllyMcBeal</Series<wbr/>><br/> <Title/><br/> </Program><br/> </Channel><br/> <Channel><br/> <Name>Channel 5</Name><br/> <Program><br/> <Start>2001-07-05T19: 00: 00<wbr/></Start><br/> <Duration>PT30M</Duration><wbr/><br/> <Series>MovieChartShow</Se<wbr/>ries><br/> <Title/><br/> </Program><br/> <Program><br/> <Start>2001-07-05T19: 30: 00<wbr/></Start><br/> <Duration>PT30M</Duration><wbr/><br/> <Series>5News</Series><br/> <Title/><br/> </Program><br/> <Program type= " vermaak " ><br/> <Start>2001-07-05T20: 00: de Slechtste die Bestuurders van de 00<wbr/></Start><br/> <Duration>PT1H</Duration><br/> <Series/><br/> <Title>The Wereld op Tape


2001-07-05T21 worden gevangen: 00: 00
PT1H55Mn>

Zwart-witte


2001-07-05T21: 55: 00
                  PT30M
                  Brookside
                  <br />            </Program><br />      </Channel><br /></TVGuide><br />==========================<wbr />==========<wbr />==========<wbr />==========<wbr />==========<wbr />==========<wbr />=</span> </div></div> <div class= " duidelijke " ></div> <div class= " qCodeSnippetRow " > <div class= " codeSnippet " ><table> <tr> <td class= " lineNumbers " > <pre> 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: </pre> </td> " codeBody " <td class= > <pre id= " codeSnippet653782 " class= " notpretty " >import java.io.*; de invoer javax.xml.parsers.*; de invoer org.w3c.dom.*; de invoer org.xml.sax.*; de invoer javax.xml.transform.*; de invoer javax.xml.transform.dom.DOMSource; de invoer javax.xml.transform.stream.StreamResult; openbare klasse DisplayElementNodes { statische openbare nietige leiding (Koord [] arg) { probeer { BufferedReader BF = nieuwe BufferedReader (nieuwe InputStreamReader (System.in)); System.out.print („ga een Xml- dossier in - naam: “); xmlFile koord = bf.readLine (); Het dossier van het dossier = nieuw (xmlFile) Dossier; als (file.exists ()){ De fabriek van DocumentBuilderFactory = DocumentBuilderFactory.newInstance (); De bouwer van DocumentBuilder = factory.newDocumentBuilder (); Document doc. = (xmlFile) builder.parse; tranFactory TransformerFactory = TransformerFactory.newInstance (); Transformator aTransformer = tranFactory.newTransformer (); // ============================================================================================================= // krijgt knopenlijst van alle elementen De lijst van NodeList = doc.getElementsByTagName („Reeks“); voor (int. i=0; i<list.getLength (); i++) { // krijgt element Het element van het element = (Element) list.item (I); Bron src = nieuwe DOMSource (element); System.out.println („Knoop nr: “ + I + + „is“ element.getNodeName ()); System.out.println („Zijn overeenkomstige xml vertegenwoordiging: “); Resultaat dest = nieuwe StreamResult (System.out); aTransformer.transform (src, dest); System.out.println („\ n“); } } anders { xmlFile System.out.println (+ „(dossier - naam) vindt niet! “); } } vangst (Uitzondering e) { e.getMessage (); } } } </pre> </td> </tr> </table></div> </div> <div class= " ontruimt " ></span></h4> </td> </tr> <tr><td height="2px"></td></tr> <tr style="background-color:#f2f4f6"><td > <h2 style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;color:red;font-weight:bold"> <span id="ContentPlaceHolder1_tieude_as">Antwoord : Vind siblings en ouderknopen in DOM</span> </h2></td></tr> <tr> <td valign="top"> <h5><span id="ContentPlaceHolder1_ans" style="font-family:Tahoma,Geneva,sans-serif;font-size:12px;font-weight:normal;color:#000000"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <div class="KonaBody"><div class="richText"> echt zal het u niet direct sibling… aangezien er tekstknopen binnen - tussen zijn terugkeren,<br />voor b.v.,<br /><br />om de waarde van de Knoop van het Begin te vinden u somethin als dit moet hebben,<br /><br />Koord findStart (de reeks van de Knoop) {<br /><br />    Knoop startNode = series.getPreviousSibling (<wbr />);<br />   als (startNode.getNodeName.eqauls<wbr /> („Begin“<wbr />)) {<br />     terugkeer startNode.getChildNodes () .items<wbr /> (0) .getNodeValue<wbr /><wbr /> ();<br />   } anders {<br />     terugkeer findStartNode (statrNode);<br />   }<br />}<br /><br />ik heb slechts voor vorige siblings. getoond. waarschijnlijk zult u thro NextSiblings moeten ook gaan,<br /></div></div> <!-- text-ad & richText --> <span class="isBotVideo"> <span class="isBotVideo"></span></span> </div> </span></h5> </td> </tr> <tr><td height="5px"></td></tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><table width="100%" height="25px" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="100px" bgcolor="#FFFFFF" style="padding-left:5px"><span class="f11blue">Andere oplossingen</span></td> <td background="http://programming4.us/images/bg-ch.gif"> </td> </tr> </table></td> </tr> <tr> <td style="padding:5px"> <div> <table id="ContentPlaceHolder1_DataList2" cellspacing="0" style="width:100%;border-collapse:collapse;"> <tr> <td> <table> <tr> <td valign="top" align="left"> <a href='http://faq.wmlcloud.com/nl/microsoft/31408.aspx' class="a4"> <li> Somebody verzendt emialsvorm mijn hotmailrekening</li></a> </td> </tr> </table> </td> </tr><tr> <td> <table> <tr> <td valign="top" align="left"> <a href='http://faq.wmlcloud.com/nl/microsoft/20548.aspx' class="a4"> <li> een programma probeert om het volgende e-mailbericht uit uw naam te verzenden - de Levende post van Vensters</li></a> </td> </tr> </table> </td> </tr><tr> <td> <table> <tr> <td valign="top" align="left"> <a href='http://faq.wmlcloud.com/nl/software/39960.aspx' class="a4"> <li> Kleine Statische IP Bedrijfs van de Server 2008 verandering</li></a> </td> </tr> </table> </td> </tr><tr> <td> <table> <tr> <td valign="top" align="left"> <a href='http://faq.wmlcloud.com/nl/microsoft/14628.aspx' class="a4"> <li> sharepoint stichting 2010 op met 32 bits?</li></a> </td> </tr> </table> </td> </tr><tr> <td> <table> <tr> <td valign="top" align="left"> <a href='http://faq.wmlcloud.com/nl/software/34048.aspx' class="a4"> <li> Word 2003 die - met lijsten, rijen, en cellen werken</li></a> </td> </tr> </table> </td> </tr><tr> <td> <table> <tr> <td valign="top" align="left"> <a href='http://faq.wmlcloud.com/nl/microsoft/23188.aspx' class="a4"> <li> Navigeer aan de pagina van een specifiek punt op een gridview</li></a> </td> </tr> </table> </td> </tr><tr> <td> <table> <tr> <td valign="top" align="left"> <a href='http://faq.wmlcloud.com/nl/microsoft/28140.aspx' class="a4"> <li> Hyperlink die het diagram/de Tekening activeren</li></a> </td> </tr> </table> </td> </tr><tr> <td> <table> <tr> <td valign="top" align="left"> <a href='http://faq.wmlcloud.com/nl/microsoft/17284.aspx' class="a4"> <li> Apple iWeb - hoe te om HTML aan Schijf de website via FTP te publiceren te bewaren of?</li></a> </td> </tr> </table> </td> </tr><tr> <td> <table> <tr> <td valign="top" align="left"> <a href='http://faq.wmlcloud.com/nl/microsoft/22232.aspx' class="a4"> <li> sql - datumformaat</li></a> </td> </tr> </table> </td> </tr><tr> <td> <table> <tr> <td valign="top" align="left"> <a href='http://faq.wmlcloud.com/nl/microsoft/11356.aspx' class="a4"> <li> Het van een lus voorzien over de tellers van googlekaarten v3</li></a> </td> </tr> </table> </td> </tr> </table> </div></td> </tr> </table></td> </tr> </table> </div> </td></tr> </table> </form> </td> </tr> <tr> <td> </td> </tr> </table></td> </tr> </table></td> </tr> </table></td> </tr> </table> </td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td background="http://tutorial.wmlcloud.com/images/bg-mn.jpg" height="30px" style="padding:5px;color:#ffffff;font-size:12px; font-family:Tahoma, Geneva, sans-serif;text-decoration: none;" ></td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="http://tutorial.wmlcloud.com/images/bo-l.png" alt="programming4us" width="8" height="9" /></td> <td bgcolor="#FFFFFF" width="100%"></td> <td><img src="http://tutorial.wmlcloud.com/images/bo-r.png" alt="programming4us" width="8" height="9" /></td> </tr> </table></td> </tr> </table></td> </tr> </table></td> </tr> <tr><td height="2px"></td></tr> <tr><td> <div align="center"> </div> </td> </tr> <tr><td height="3px"></td></tr> <tr> <td height="2px"></td> </tr> <tr> <td align="left"> <table cellpadding="0" cellspacing="0" width="100%" align="left"> <tr> <td valign="top"> <div id="en"><a href='http://faq.wmlcloud.com/software/73354.aspx'><img src='http://faq.wmlcloud.com/flags/en.gif'></a></div> </td> <td valign="top"> <div id="de"><a href='http://faq.wmlcloud.com/de/software/73354.aspx'><img src='http://faq.wmlcloud.com/flags/de.gif'></a></div> </td> <td valign="top"> <div id="es"><a href='http://faq.wmlcloud.com/es/software/73354.aspx'><img src='http://faq.wmlcloud.com/flags/es.gif'></a></div> </td> <td valign="top"> <div id="fr"><a href='http://faq.wmlcloud.com/fr/software/73354.aspx'><img src='http://faq.wmlcloud.com/flags/fr.gif'></a></div> </td> <td valign="top"> <div id="nl"><a href='http://faq.wmlcloud.com/nl/software/73354.aspx'><img src='http://faq.wmlcloud.com/flags/nl.gif'></a></div> </td> <td valign="top"> <div id="it"><a href='http://faq.wmlcloud.com/it/software/73354.aspx'><img src='http://faq.wmlcloud.com/flags/it.gif'></a></div> </td> <td valign="top"> <div id="ru"><a href='http://faq.wmlcloud.com/ru/software/73354.aspx'><img src='http://faq.wmlcloud.com/flags/ru.gif'></a></div> </td> <td valign="top"> <div id="se"><a href='http://faq.wmlcloud.com/se/software/73354.aspx'><img src='http://faq.wmlcloud.com/flags/se.gif'></a></div> </td> <td valign="top"> </td> <td valign="top"> <div id="pt"><a href='http://faq.wmlcloud.com/pt/software/73354.aspx'><img src='http://faq.wmlcloud.com/flags/pt.gif'></a></div> </td> <td valign="top"> </td> <td valign="top"> </td> </tr> </table> </td> </tr> <tr> <td height="2px"></td> </tr> </td></tr> </table> <script src="//cdn.intergient.com/ramp_core.js"></script> </body> </html>