Subject:Using xsl to transfer XML data to a .pdf document Author:Alastair Scollay Date:26 May 2006 01:37 AM
I am new to both XSL and to this forum, so apologies in advance if this has question already been asked.
I am trying to update an existing .xsl file to transfer XML data to a .pdf document.
(1) The section of XML data in question is in the following format:
<top-level-tag>
<second-level-tag>
<type-code>TOP</type-code>
<indent-level>0</indent-level>
<description>My first Description</description>
<total>0<total>
</second-level-tag>
<second-level-tag>
<type-code>SUB</type-code>
<indent-level>1</indent-level>
<description>My first sub description</description>
<total>15.0</capped-total>
</second-level-tag>
<second-level-tag>
<type-code>SUB</type-code>
<indent-level>1</indent-level>
<description>My second sub description</description>
<total>15.0</capped-total>
</second-level-tag>
<top-level-tag>
<second-level-tag>
<type-code>TOP</type-code>
<indent-level>0</indent-level>
<description>My Second Description</description>
<total>0<total>
</second-level-tag>
<second-level-tag>
<type-code>SUB</type-code>
<indent-level>1</indent-level>
<description>My third sub description</description>
<total>15.0</capped-total>
</second-level-tag>
<second-level-tag>
<type-code>SUB</type-code>
<indent-level>1</indent-level>
<description>My fourth sub description</description>
<total>15.0</capped-total>
</second-level-tag>
</top-level-tag>
(2) I want it to appear in the .pdf like this
My First Description
My first sub description
My second sub description
My Second Description
My third sub description
My fourth sub description
(3) Unfortunately, it's appearing as follows:
My First Description
My first sub description
My second sub description
My third sub description
My fourth sub description
My Second Description
My first sub description
My second sub description
My third sub description
My fourth sub description
I can understand the logic flaw in my code - it is grabbing EVERY sub description for EACH description but am not sure how to
amend this such that it only grabs the data I want for each section.