Frage : Entdeckunggeschwister- und -elternteilnullpunkte in DOM

Hallo, diesen Code, die habend alle Nullpunkte Reihe finden, möchte ich drucken, was in dieser Element Reihe ist, und einen anderen Geschwisternullpunkt auch drucken, den shos das Anfangselement, das mir die Zeit erklärt, die Reihe an einem anderen Kanal…

=============================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= " Lieblings" ><br/> <Start>2001-07-05T19: 30: 00<wbr/></Start><br/> <Duration>PT30M</Duration><wbr/><br/> <Series>EastEnders</Series<wbr/>><br/> <Title/><br/> Gesundheitsschrecken der <Description>Marks zwingt ihn, seine Zukunft mit Lisa nachzuprüfen, während Jamie zwischen Sonia und 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/> <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/> <Producer><br/> <Name>Emma Turner</Name><br/> zerrissen                  </Producer><br/> </Program><br/> <Program type= " dokumentarisches " ><br/> <Start>2001-07-05T20: 00: 00<wbr/></Start><br/> <Duration>PT45M</Duration><wbr/><br/> <Series/><br/> <Title>Get real mit 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= " interessantes " ><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= " Lieblings" ><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= " Unterhaltung " ><br/> <Start>2001-07-05T20: 00: schlechteste Fahrer der 00<wbr/></Start><br/> <Duration>PT1H</Duration><br/> <Series/><br/> <Title>The Welt verfingen auf Tape


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

Schwarzweiss-


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= " freies " ></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: 6: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: </pre> </td> <td class= " codeBody " > <pre id= " codeSnippet653782 " class= " notpretty " >import java.io.*; Import javax.xml.parsers.*; Import org.w3c.dom.*; Import org.xml.sax.*; Import javax.xml.transform.*; Import javax.xml.transform.dom.DOMSource; Import javax.xml.transform.stream.StreamResult; allgemeine Kategorie DisplayElementNodes { statische Öffentlichkeitslücke hauptsächlich (Schnur [] arg) { Versuch { BufferedReader BF = neues BufferedReader (neues InputStreamReader (System.in)); System.out.print („einen XML Dateinamen eintragen: "); Schnur xmlFile = bf.readLine (); Aktenakte = neue Akte (xmlFile); wenn (file.exists ()){ DocumentBuilderFactory Fabrik = DocumentBuilderFactory.newInstance (); DocumentBuilder Erbauer = factory.newDocumentBuilder (); Dokument Doc. = builder.parse (xmlFile); TransformerFactory tranFactory = TransformerFactory.newInstance (); Transformator aTransformer = tranFactory.newTransformer (); // ============================================================================================================= // erhalten Nullpunktliste aller Elemente NodeList Liste = doc.getElementsByTagName („Reihe“); für (int i=0; i<list.getLength (); i++) { // erhalten Element Elementelement = (Element) list.item (i); Quellsrc = neues DOMSource (Element); System.out.println („Nullpunktnr.: “ + „ist“ i + + element.getNodeName ()); System.out.println („seine entsprechende xml Darstellung: "); Resultat DEST = neues StreamResult (System.out); aTransformer.transform (src, DEST); System.out.println („\ n“); } } sonst { System.out.println (xmlFile + „(Dateiname) findet nicht! "); } } Fang (Ausnahme e) { e.getMessage (); } } } </pre> </td> </tr> </table></div> </div> <div class= " frei " ></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">Antwort : Entdeckunggeschwister- und -elternteilnullpunkte 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"> wirklich zurückbringt es Sie nicht die Geschwister direkt… direkt, da es Textnullpunkte in-between gibt,<br />für z.B.,<br /><br />zu Wert des Anfangsnullpunktes finden, den Sie somethin so haben müssen,<br /><br />Schnur findStart (Nullpunkt-Reihe) {<br /><br />    Nullpunkt startNode = series.getPreviousSibling (<wbr />);<br />   wenn (startNode.getNodeName.eqauls<wbr /> („Anfang“<wbr />)) {<br />     RückholstartNode.getChildNodes () .items<wbr /> (0) .getNodeValue<wbr /><wbr /> ();<br />   } sonst {<br />     RückholfindStartNode (statrNode);<br />   }<br />}<br /><br />ich dargestellt nur für vorhergehende Geschwister. vermutlich müssen Sie auch gehen thro NextSiblings,<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">Weitere Lösungen</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/de/software/37020.aspx' class="a4"> <li> Wort-Presse, die Frage bewirtet</li></a> </td> </tr> </table> </td> </tr><tr> <td> <table> <tr> <td valign="top" align="left"> <a href='http://faq.wmlcloud.com/de/microsoft/3104.aspx' class="a4"> <li> asp.net: Mein Problem ist, benutze ich einen ajax Ergänzung Kalender, um BeginDate u. EndDate Werte einzutragen</li></a> </td> </tr> </table> </td> </tr><tr> <td> <table> <tr> <td valign="top" align="left"> <a href='http://faq.wmlcloud.com/de/microsoft/30688.aspx' class="a4"> <li> Silverlight 4 UI Ereignisse</li></a> </td> </tr> </table> </td> </tr><tr> <td> <table> <tr> <td valign="top" align="left"> <a href='http://faq.wmlcloud.com/de/microsoft/19056.aspx' class="a4"> <li> wie kann ich irgendeine Bildentschließung online ändern und sie zum lokalen PC dann innen sparen??</li></a> </td> </tr> </table> </td> </tr><tr> <td> <table> <tr> <td valign="top" align="left"> <a href='http://faq.wmlcloud.com/de/microsoft/24360.aspx' class="a4"> <li> ZFS Sicherungshilfe Ubuntu 10.0.4 LTS</li></a> </td> </tr> </table> </td> </tr><tr> <td> <table> <tr> <td valign="top" align="left"> <a href='http://faq.wmlcloud.com/de/microsoft/12724.aspx' class="a4"> <li> Form-Frage für Kristallreports</li></a> </td> </tr> </table> </td> </tr><tr> <td> <table> <tr> <td valign="top" align="left"> <a href='http://faq.wmlcloud.com/de/microsoft/18032.aspx' class="a4"> <li> Betreffend INOTES in Lotos 8.5</li></a> </td> </tr> </table> </td> </tr><tr> <td> <table> <tr> <td valign="top" align="left"> <a href='http://faq.wmlcloud.com/de/software/38824.aspx' class="a4"> <li> Mühen, die ZWISCHEN Logik erhalten zu arbeiten</li></a> </td> </tr> </table> </td> </tr><tr> <td> <table> <tr> <td valign="top" align="left"> <a href='http://faq.wmlcloud.com/de/microsoft/27188.aspx' class="a4"> <li> Spannungs-Sensor ermittelte einen Ausfall auf Bediener DELL-PowerEdge 2650</li></a> </td> </tr> </table> </td> </tr><tr> <td> <table> <tr> <td valign="top" align="left"> <a href='http://faq.wmlcloud.com/de/microsoft/32492.aspx' class="a4"> <li> broadcom NIC teaming</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>