Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Need help with printing out all nodes with this xml

From: naijacoder <lurowam@-----.--->
To: NULL
Date: 6/24/2009 4:59:00 AM
Thanks Neil i just missed the detail tag(See below)
this is it below
So i believe the below should match
<xsl:for-each select=3D"/report/report_info/detail/plan">
<xsl:value-of select=3D"multi-service/multi-mobile"/>
<xsl:value-of select=3D"multi-service/multi-handset-code"/>
</xsl:for-each>

I can retrieve my plan-desc node here by doing     <b><xsl:value-of
select=3D"plan-desc"/>
My problem is with this nodes(I know i don't need to add a dot at the
end)
I can't get all the text to print out like so:
New
NOHANDSET
No Handset - Service Only GSM
TESTNOK1
0411777777

Port
NOHANDSET
No Handset - Service Only GSM
TESTCJ1

Hope you can help.
PS* I don't thave any other template match apart from the root which
has
<xsl:template match=3D"/">


xml below
---------------------------------------------------------------------------=
----------------------
<report>
  <report_info>
<detail>
<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>
</detail>
  </report_info>
</report>




On Jun 24, 8:39=A0pm, "Neil Smith [MVP Digital Media]" <n...@nospam.com>
wrote:
> On Wed, 24 Jun 2009 00:47:04 -0700 (PDT), naijacoder
>
> <luro...@gmail.com> 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=3D"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=3D"/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=3D"multi-service/multi-mobile/."/>
>
> You could as easily use this in your example document
> <xsl:value-of select=3D"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>
> > =A0<report_info>
> ><plan>
> > =A0 =A0 =A0 =A0<plan-code>BSHM0099BNAA01 =A0</plan-code>
> > =A0 =A0 =A0 =A0<plan-desc>Shared Bus Cap $99 24 Mth =A0 =A0 </plan-desc=
>
> > =A0 =A0 =A0 =A0<ban>422222265 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 </ban>
> > =A0 =A0 =A0 =A0<finance-amount>0</finance-amount>
> > =A0 =A0 =A0 =A0<finance-duration></finance-duration>
> > =A0 =A0 =A0 =A0<connection-type>Vodafone MultiServ New =A0 =A0 =A0 =A0<=
/connection-
> >type>
> > =A0 =A0 =A0 =A0<multi-service>
> > =A0 =A0 =A0 =A0 =A0<multi-connect-type>New</multi-connect-type>
> > =A0 =A0 =A0 =A0 =A0<multi-handset-code>NOHANDSET =A0 =A0 =A0 </multi-ha=
ndset-code>
> > =A0 =A0 =A0 =A0 =A0<multi-handset-desc>No Handset - Service Only GSM </=
multi-
> >handset-desc>
> > =A0 =A0 =A0 =A0 =A0<multi-handset-serial>TESTNOK1 =A0 =A0 =A0 =A0 =A0 =
=A0</multi-handset-
> >serial>
> > =A0 =A0 =A0 =A0 =A0<multi-
> >mobile>0411777777 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0</multi-
> >mobile>
> > =A0 =A0 =A0 =A0 =A0<multi-simcard>SIMCARDCJPOST =A0 </multi-simcard>
> > =A0 =A0 =A0 =A0 =A0<multi-simserial>TESTCJ1 =A0 =A0 =A0 =A0 =A0 =A0 </m=
ulti-simserial>
> > =A0 =A0 =A0 =A0</multi-service>
> > =A0 =A0 =A0 =A0<multi-service>
> > =A0 =A0 =A0 =A0 =A0<multi-connect-type>Port</multi-connect-type>
> > =A0 =A0 =A0 =A0 =A0<multi-handset-code>NOHANDSET =A0 =A0 =A0 </multi-ha=
ndset-code>
> > =A0 =A0 =A0 =A0 =A0<multi-handset-desc>No Handset - Service Only GSM </=
multi-
> >handset-desc>
> > =A0 =A0 =A0 =A0 =A0<multi-handset-serial>TESTCJ1 =A0 =A0 =A0 =A0 =A0 =
=A0 </multi-handset-
> >serial>
> > =A0 =A0 =A0 =A0 =A0<multi-
> >mobile>0411888888 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0</multi-
> >mobile>
> > =A0 =A0 =A0 =A0 =A0<multi-simcard>SIMCARDCJPOST =A0 </multi-simcard>
> > =A0 =A0 =A0 =A0 =A0<multi-simserial>TESTCJ2 =A0 =A0 =A0 =A0 =A0 =A0 </m=
ulti-simserial>
> > =A0 =A0 =A0 =A0</multi-service>
> > =A0 =A0 =A0</plan>
> > =A0</report_info>
> ></report>
>
> ><xsl:for-each select=3D"/report/report_info/detail/plan">
>
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0<table class=3D"tabledetails" cellspacing=3D"0" style=3D"ta=
ble-
> >layout:fixed" border=3D"0" width=3D"645px">
>
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<tr>
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<td width=3D"50px"></td>
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<td>
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<xsl:if tes=
t=3D"normalize-space(.)">
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0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A0 =A0 =A0 =A0 =A0 =A0 =A0<xsl:value-=
of select=3D"multi-service/multi-handset-code/."/>
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0</td>
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0</tr>
> ></table>
>
> ------------------------------------------------
> Digital Media MVP : 2004-2009http://mvp.support.microsoft.com/mvpfaqs- Hi=
de quoted text -
>
> - Show quoted text -



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent