Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Need help with printing out all nodes with this xml >Thread Next - Re: Need help with printing out all nodes with this xml Re: Need help with printing out all nodes with this xmlTo: NULL Date: 6/24/2009 10:39:00 AM On Wed, 24 Jun 2009 00:47:04 -0700 (PDT), naijacoder <lurowam@g...> wrote: >I have my xml below and i'm trying to print out all the values in the >multi-service node. >But when i do ><xsl:value-of select="multi-service/multi-mobile/."/> >I can only get the first value in the first postion. >How can i get all the values e.g >0411777777 >0411888888 >I know my for each is matching the plan node but how can i break out Well, the code you posted *cannot* match the plan node : <xsl:for-each select="/report/report_info/detail/plan"> There is no 'detail' node in your XML document at any level (and not below report_info node). So this possibly implies you are hitting the default text template provided by your XSL processor - which would output all the text nodes of the document, run together into a mess of text. That doesn't sound exactly what you described though. As you have extracted only a part of your XSL stylesheet, we cannot be certain, but my guess is you have another template which is matching the content multi-mobile and it's confusing the result (it's not the template you think is matching, which is the non-effective xsl:for-each above) PS it's not necessary (required) to use the trailing dot in <xsl:value-of select="multi-service/multi-mobile/."/> You could as easily use this in your example document <xsl:value-of select="multi-service/multi-mobile"/> as multi-mobile node has no child nodes, but only text. HTH Cheers - Neil >and match the multi-service nodes. >Thanks in Advance > >See Below: >-------------------------- > ><report> > <report_info> ><plan> > <plan-code>BSHM0099BNAA01 </plan-code> > <plan-desc>Shared Bus Cap $99 24 Mth </plan-desc> > <ban>422222265 </ban> > <finance-amount>0</finance-amount> > <finance-duration></finance-duration> > <connection-type>Vodafone MultiServ New </connection- >type> > <multi-service> > <multi-connect-type>New</multi-connect-type> > <multi-handset-code>NOHANDSET </multi-handset-code> > <multi-handset-desc>No Handset - Service Only GSM </multi- >handset-desc> > <multi-handset-serial>TESTNOK1 </multi-handset- >serial> > <multi- >mobile>0411777777 </multi- >mobile> > <multi-simcard>SIMCARDCJPOST </multi-simcard> > <multi-simserial>TESTCJ1 </multi-simserial> > </multi-service> > <multi-service> > <multi-connect-type>Port</multi-connect-type> > <multi-handset-code>NOHANDSET </multi-handset-code> > <multi-handset-desc>No Handset - Service Only GSM </multi- >handset-desc> > <multi-handset-serial>TESTCJ1 </multi-handset- >serial> > <multi- >mobile>0411888888 </multi- >mobile> > <multi-simcard>SIMCARDCJPOST </multi-simcard> > <multi-simserial>TESTCJ2 </multi-simserial> > </multi-service> > </plan> > </report_info> ></report> > > ><xsl:for-each select="/report/report_info/detail/plan"> > > <table class="tabledetails" cellspacing="0" style="table- >layout:fixed" border="0" width="645px"> > > <tr> > <td width="50px"></td> > <td> > <xsl:if test="normalize-space(.)"> > <b><xsl:value-of select="plan-desc"/> > </b> > </xsl:if> > </td> ></tr> ><tr> > <td width="50px"></td> > <td> > <xsl:value-of select="multi-service/multi-mobile/."/> > <xsl:value-of select="multi-service/multi-handset-code/."/> > </td> > </tr> ></table> ------------------------------------------------ Digital Media MVP : 2004-2009 http://mvp.support.microsoft.com/mvpfaqs | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
