Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: XML XSLT
hi all, today is my first day with XSLT. may i get help from you?
i have a xml like this:
<nitf>
<body>
<body.content>
<block>
<p >THE phone-call on Thursday evening</p>
<p>The caller was an active .</p>
<p>He had a point.</p>
<-- like this 100 para-->
 
</block>
</body.content>
</body>
</nitf>
if i use a xslt like this:
<xsl:for-each select="nitf/body/body.content/block">
<p>
            <xsl:value-of select="p"/>
</p>
          </xsl:for-each>
it returns only first para value.
and if i use like this:
<xsl:for-each select="nitf/body/body.content/block/p">
<p>
            <xsl:value-of select="p"/>
</p>
          </xsl:for-each>
then it shows nothing..
how can i get all 100 para values ?
Posted 13-Dec-12 7:36am
Edited 13-Dec-12 8:15am
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

There is only one block. You need to do a for each on the p tags to iterate over them. ( well, it's not a for each, it's a matching rule )
  Permalink  
Comments
choudhary.sumit at 14-Dec-12 2:24am
   
can you provide me a XSLT format for this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web01 | 2.8.150327.1 | Last Updated 13 Dec 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100