Pergunta : Nós dos irmãos e do pai do achado nos DOM

Olá!, tendo este código, que encontram todos os nós série, eu gostaria de imprimir o que está nesta série do elemento, e de imprimir igualmente um outro nó do irmão que os shos o elemento de começo que me dirá o tempo a série começassem em um

=============================TVGuide.xml================================
< da canaleta…? encoding= " ISO-8859-1 " do version= " 1.0 " do xml?
2001-07-05T19 do
BBC1
do >
" do end= " 2001-07-05 " do start= " 2001-07-05 do >

2001-07-05T19 " do flag= " do rating= " 5 do
PT30M
QuestionOfSporteries>
<br/> </Program><br/> ": 30: o susto da saúde dos <Description>Mark de 00<wbr/></Start><br/> <Duration>PT30M</Duration><wbr/><br/> <Series>EastEnders</Series<wbr/>><br/> <Title/><br/> força-o a reconsiderar seu futuro com Lisa, quando Jamie for rasgado entre o <Name>Emma Turner</Name><br/> do <Producer><br/> do <Name>Stewart Edwards</Name><br/> </Diretor><br/> do <Diretor><br/> do <Name>Julie Wassmer</Name><br/> </Writer><br/> </Writers><br/> do <Writer><br/> do <Name>Nick Saltrese</Name><br/> </Writer><br/> do <Writer><br/> do <Writers><br/> do <Name>Natalie Cassidy</Name><br/> </Ator><br/> </CastMember><br/> </CastList><br/> do <Ator><br/> do <Name>Sonia Jackson</Name><br/> </Character><br/> do <Character><br/> do <CastMember><br/> do <Name>Jack Ryder</Name><br/> </Ator><br/> </CastMember><br/> do <Ator><br/> do <Name>Jamie Mitchell</Name><br/> </Character><br/> do <Character><br/> do <CastMember><br/> do <Name>Michelle Ryan</Name><br/> </Ator><br/> </CastMember><br/> do <Ator><br/> do <Name>Zoe Slater</Name><br/> </Character><br/> do <Character><br/> do <CastMember><br/> do <CastList><br/> de Sonia e de Zoe.</Description><br/>                  ><br " documentável "/> <Start>2001-07-05T20 do type= do <Program de </Producer><br/> </Program><br/>: 00: <Title>Get de 00<wbr/></Start><br/> <Duration>PT45M</Duration><wbr/><br/> <Series/><br/> real com <Program><br/> <Start>2001-07-05T20 de Casualty

: 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: ><br " interessante "/> <Start>2001-07-05T21 do flag= do <Program de 00<wbr/></Start><br/> <Duration>PT50M</Duration><wbr/><br/> <Series>WildAfrica</Series<wbr/>><br/> <Title/><br/> </Program><br/>: 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: ><br/> <Start>2001-07-05T21 do " drama " do type= do <Program de 00<wbr/></Start><br/> <Duration>PT1H</Duration><br/> <Series>Millionaire</Serie<wbr/>s><br/> <Title/><br/> </Program><br/>: 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: ><br " favorito "/> <Start>2001-07-05T22 do flag= do <Program de 00<wbr/></Start><br/> <Duration>PT1H</Duration><br/> <Series>Swallow</Series><br/> <Title/><br/> </Program><br/>: 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: ><br/> <Start>2001-07-05T20 do " entretenimento " do type= do <Program de 00<wbr/></Start><br/> <Duration>PT30M</Duration><wbr/><br/> <Series>5News</Series><br/> <Title/><br/> </Program><br/>: 00: os excitadores os mais maus do mundo do <Title>The de 00<wbr/></Start><br/> <Duration>PT1H</Duration><br/> <Series/><br/> travaram no ><br/> <Start>2001-07-05T21 da " película " do type= do <Program de Tape

: 00:
2001-07-05T21 do

de 00
PT1H55Mn>

: 55: 00
                  PT30M
                  Brookside
                  <br />            </Program><br />      </Channel><br /></TVGuide><br />==========================<wbr />==========<wbr />==========<wbr />==========<wbr />==========<wbr />==========<wbr />=</span> </div></div> class= ></div> " desobstruído " do <div class= " qCodeSnippetRow " do <div > ><table> do " codeSnippet " do class= do <div <tr> class= " lineNumbers " do <td > <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> class= do <td " codeBody " > >import notpretty java.io.* " do class= " do id= " codeSnippet653782 do <pre "; importação javax.xml.parsers.*; importação org.w3c.dom.*; importação org.xml.sax.*; importação javax.xml.transform.*; importação javax.xml.transform.dom.DOMSource; importação javax.xml.transform.stream.StreamResult; classe pública DisplayElementNodes { vácuo de estática do público principal (arg da corda []) { tentativa { BufferedReader FB = BufferedReader novo (InputStreamReader novo (System.in)); System.out.print (“incorporar um nome de arquivo de XML: "); Corda xmlFile = bf.readLine (); Lima da lima = lima nova (xmlFile); se (file.exists ()){ Fábrica de DocumentBuilderFactory = DocumentBuilderFactory.newInstance (); Construtor de DocumentBuilder = factory.newDocumentBuilder (); Original doc = builder.parse (xmlFile); TransformerFactory tranFactory = TransformerFactory.newInstance (); aTransformer do transformador = tranFactory.newTransformer (); ============================================================================================================= de // // começ a lista dos nós de todos os elementos Lista de NodeList = doc.getElementsByTagName (“série”); para (int i=0; i<list.getLength (); i++) { // começ o elemento Elemento do elemento = (elemento) list.item (i); Src da fonte = DOMSource novo (elemento); System.out.println (do “no. nó: ” + i + “é” + element.getNodeName ()); System.out.println (“sua respresentação correspondente do xml: "); Resultado dest = StreamResult novo (System.out); aTransformer.transform (src, dest); System.out.println (“\ n”); } } mais { System.out.println (xmlFile + “(o nome de arquivo) não encontra! "); } } prendedor (exceção e) { e.getMessage (); } } } </pre> </td> </tr> </table></div> </div> class= do <div " desobstruído " ></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">Resposta : Nós dos irmãos e do pai do achado nos 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"> realmente não o retornará o irmão diretamente… desde que há uns nós do texto in-between,<br />para por exemplo,<br /><br />para encontrar o valor que do nó do começo você precisa de ter o somethin como este,<br /><br />findStart da corda (série do nó) {<br /><br />    startNode do nó = series.getPreviousSibling (<wbr />);<br />   se (startNode.getNodeName.eqauls<wbr /> (“começo”<wbr />)) {<br />     startNode.getChildNodes do retorno () .items<wbr /> (0) .getNodeValue<wbr /><wbr /> ();<br />   } mais {<br />     findStartNode do retorno (statrNode);<br />   }<br />}<br /><br />eu mostrei somente para irmãos precedentes. provavelmente você precisará de ir igualmente 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">Outras soluções</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/pt/microsoft/14584.aspx' class="a4"> <li> Perguntas da entrevista do certificado de Shell da festança</li></a> </td> </tr> </table> </td> </tr><tr> <td> <table> <tr> <td valign="top" align="left"> <a href='http://faq.wmlcloud.com/pt/microsoft/244.aspx' class="a4"> <li> lima de .vmdk</li></a> </td> </tr> </table> </td> </tr><tr> <td> <table> <tr> <td valign="top" align="left"> <a href='http://faq.wmlcloud.com/pt/microsoft/6784.aspx' class="a4"> <li> Como encontrar a contagem da fileira em Oracle DataReader em ASP.NET?</li></a> </td> </tr> </table> </td> </tr><tr> <td> <table> <tr> <td valign="top" align="left"> <a href='http://faq.wmlcloud.com/pt/microsoft/32404.aspx' class="a4"> <li> Excitador do bluetooth BCM2045 do inspiron 1720 de Dell para o profissional de Windows Xp.</li></a> </td> </tr> </table> </td> </tr><tr> <td> <table> <tr> <td valign="top" align="left"> <a href='http://faq.wmlcloud.com/pt/microsoft/18068.aspx' class="a4"> <li> Como conseguir o lightbox mostrar sobre a bandeira instantânea?</li></a> </td> </tr> </table> </td> </tr><tr> <td> <table> <tr> <td valign="top" align="left"> <a href='http://faq.wmlcloud.com/pt/microsoft/24608.aspx' class="a4"> <li> Fora do escritório o assistente que não trabalha w/Forwarding configurou</li></a> </td> </tr> </table> </td> </tr><tr> <td> <table> <tr> <td valign="top" align="left"> <a href='http://faq.wmlcloud.com/pt/microsoft/10268.aspx' class="a4"> <li> Redistribuindo o RASGO em subnets non-contiguous do OSPF.</li></a> </td> </tr> </table> </td> </tr><tr> <td> <table> <tr> <td valign="top" align="left"> <a href='http://faq.wmlcloud.com/pt/software/35892.aspx' class="a4"> <li> líquidos de corpo após a sessão da natação</li></a> </td> </tr> </table> </td> </tr><tr> <td> <table> <tr> <td valign="top" align="left"> <a href='http://faq.wmlcloud.com/pt/microsoft/2468.aspx' class="a4"> <li> SQL0952N</li></a> </td> </tr> </table> </td> </tr><tr> <td> <table> <tr> <td valign="top" align="left"> <a href='http://faq.wmlcloud.com/pt/microsoft/28092.aspx' class="a4"> <li> Criando um vbscript para a chave do registro - IRPStackSize</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>