Click here to Skip to main content
15,884,892 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all, today is my first day with XSLT. may i get help from you?
i have a xml like this:
XML
<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:
XML
<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:
XML
<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
Updated 13-Dec-12 7:15am
v2

1 solution

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 )
 
Share this answer
 
Comments
choudhary.sumit 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900