Loop in xslt

Here should go questions about transforming XML with XSLT and FOP.
saurav.bhadani
Posts: 2
Location: India

Loop in xslt

Thu Nov 15, 2007 7:26 am

I have an xml file with more the 500 node of same type. All the node have different attribute. I have to select 5 node in that and create a table in html. All the 5 node have 3 child node. The 1st child node of all the 5 node should generate the 1st table and the 2nd child node of all the 5 node will generate the second table.

Let me clear u with the example
Node 1
<Answer name="q_personalProperty_userDetailDescription TE">
<RptValue>
<TextValue>cccc</TextValue>
<TextValue>dddd</TextValue>
<TextValue>oiuo</TextValue>
<TextValue>765gjj</TextValue>
</RptValue>
</Answer>
Node 2
<Answer name="q_personalProperty_userDetailvalue NU">
<RptValue>
<NumValue>1111.00</NumValue>
<NumValue>2222.00</NumValue>
<NumValue>1212.00</NumValue>
<NumValue>1232.00</NumValue>
</RptValue>
</Answer>
Node 3
<Answer name="q_realProperty_otheruserID NU">
<RptValue>
<NumValue>109</NumValue>
<NumValue>109</NumValue>
</RptValue>
</Answer>
Node 4
<Answer name="q_realProperty_otherotherPropertyName TE">
<RptValue>
<TextValue>aaaaa</TextValue>
<TextValue>bbbbb</TextValue>
</RptValue>
</Answer>

Output

Table1
Name Price
cccc 1111.00

Table2
Name Price
dddd 2222.00

Table3
Name Price
oiuo 1212.00

Table4
Name Price
765gjj 1232.00

Now my problem
1:Who to select the first 2 node?
2:How to run a loop which give the output?

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 0 guests