Loop in xslt
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 2
- Joined: Thu Nov 15, 2007 7:06 am
- Location: India
Loop in xslt
Post by saurav.bhadani »
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?
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?
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service