Click here to Skip to main content
16,004,991 members
Home / Discussions / XML / XSL
   

XML / XSL

 
GeneralRe: How to load xml file to a datatable Pin
Diego F.20-Sep-07 7:26
Diego F.20-Sep-07 7:26 
Questionxml stylesheet to customize Excel - How to change column width Pin
umakemesik18-Sep-07 11:59
umakemesik18-Sep-07 11:59 
AnswerRe: xml stylesheet to customize Excel - How to change column width Pin
Ed.Poore18-Sep-07 12:44
Ed.Poore18-Sep-07 12:44 
QuestionHelp need for XSL file Pin
_anil_17-Sep-07 23:03
_anil_17-Sep-07 23:03 
QuestionProblem with SQL Server bulk load XML def Pin
mintxelas17-Sep-07 22:44
mintxelas17-Sep-07 22:44 
Questionlimited iteration Pin
TClarke14-Sep-07 2:11
TClarke14-Sep-07 2:11 
AnswerRe: limited iteration Pin
George L. Jackson14-Sep-07 11:43
George L. Jackson14-Sep-07 11:43 
GeneralRe: limited iteration Pin
TClarke17-Sep-07 0:28
TClarke17-Sep-07 0:28 
Hi, thanks for the interest.
Here's a chunk of the XML, simplified so as not to consume too much space. As you can see there should be 3 pages of output. Whenever the BLOCKSEQUENCE value returns to 1 a new page started. Therefore, there should be three tables on three pages. The first table should have three rows. The second should have two rows and the third should have one row. I am at a loss as to how to iterate over this XML in such a way as how to do this.

<?xml version="1.0" ?>
<ROWDATA>
<ROW>
<TABLE_ROW_DETAILS>XSL-FO to describe the row of a table</TABLE_ROW_DETAILS>
<BLOCKSEQUENCE>1</BLOCKSEQUENCE>
</ROW>
<TABLE_ROW_DETAILS>to describe the row of a table</TABLE_ROW_DETAILS>
<BLOCKSEQUENCE>2</BLOCKSEQUENCE>

</ROW>
<ROW>
<TABLE_ROW_DETAILS>to describe the row of a table</TABLE_ROW_DETAILS>
<BLOCKSEQUENCE>3</BLOCKSEQUENCE>
</ROW>
<TABLE_ROW_DETAILS>to describe the row of a table</TABLE_ROW_DETAILS>
<BLOCKSEQUENCE>1</BLOCKSEQUENCE>

</ROW>
<ROW>
<TABLE_ROW_DETAILS>to describe the row of a table</TABLE_ROW_DETAILS>
<BLOCKSEQUENCE>2</BLOCKSEQUENCE>
</ROW>
<TABLE_ROW_DETAILS>to describe the row of a table</TABLE_ROW_DETAILS>
<BLOCKSEQUENCE>1</BLOCKSEQUENCE>

</ROW>
</ROWDATA>

My XSL so far is as follows

<xsl:template match="/">
<fo:root>
<fo:layout-master-set>
<fo:simple-page-master margin-right="0.8cm" margin-left="0.8cm" margin-bottom="0.8cm" margin-top="0.8cm" page-width="29.7cm" page-height="21cm" master-name="A4-landscape">
<fo:region-body margin-bottom="1.5cm" margin-top="1.5cm"/>
<fo:region-before extent="1.5cm"/>
<fo:region-after extent="1.0cm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<xsl:for-each select="ROWDATA/ROW">
<xsl:if test='BLOCKSEQUENCE=1'>
<xsl:call-template name="page"/>
</xsl:if>
</xsl:for-each>
</fo:root>
</xsl:template>

<xsl:template name="page">
<fo:page-sequence master-reference="A4-landscape">
<fo:flow flow-name="xsl-region-body">
<fo:block>
<fo:table text-align="left" table-layout="fixed" width="100%">
<fo:table-column column-width="0.19cm"/>
<fo:table-column column-width="1.80cm"/>
<fo:table-column column-width="4.00cm"/>
<fo:table-column column-width="2.7cm"/>
<fo:table-column column-width="3.10cm"/>
<fo:table-column column-width="2.80cm"/>
<fo:table-column column-width="0.2cm"/>
<fo:table-column column-width="1.70cm"/>
<fo:table-column column-width="1.10cm"/>
<fo:table-column column-width="0.2cm"/>
<fo:table-column column-width="0.02cm"/>
<fo:table-column column-width="0.9cm"/>
<fo:table-column column-width="0.01cm"/>
<fo:table-column column-width="2.4cm"/>
<fo:table-column column-width="3.7cm"/>
<fo:table-column column-width="0.9cm"/>
<fo:table-column column-width="2.4cm"/>
<fo:table-body>
<xsl:call-template name="pageHeader"/>

//Here is my problem. I don't know how to call the pageBlock template the appropriate number of times.

<xsl:call-template name="pageBlock"/>

<xsl:call-template name="pageFooter"/>
</fo:table-body>
</fo:table>
</fo:block>
</fo:flow>
</fo:page-sequence>
</xsl:template>

Cheers
Tom

Philosophy: The art of never getting beyond the concept of life.
Religion: Morality taking credit for the work of luck.
GeneralRe: limited iteration [modified] Pin
George L. Jackson17-Sep-07 9:57
George L. Jackson17-Sep-07 9:57 
GeneralRe: limited iteration Pin
TClarke3-Oct-07 4:11
TClarke3-Oct-07 4:11 
Questionxml to html with c# Help Please Pin
phillippio13-Sep-07 13:14
phillippio13-Sep-07 13:14 
AnswerRe: xml to html with c# Help Please Pin
George L. Jackson14-Sep-07 1:48
George L. Jackson14-Sep-07 1:48 
GeneralRe: xml to html with c# Help Please Pin
phillippio14-Sep-07 11:11
phillippio14-Sep-07 11:11 
GeneralRe: xml to html with c# Help Please Pin
George L. Jackson14-Sep-07 11:39
George L. Jackson14-Sep-07 11:39 
QuestionWriting xml as a DiffGram Pin
steve_rm12-Sep-07 21:50
steve_rm12-Sep-07 21:50 
QuestionWant to use xml as localdatabse Pin
manuo512-Sep-07 0:01
manuo512-Sep-07 0:01 
QuestionXML file format Pin
VK-Cadec11-Sep-07 2:21
VK-Cadec11-Sep-07 2:21 
AnswerRe: XML file format Pin
George L. Jackson11-Sep-07 14:17
George L. Jackson11-Sep-07 14:17 
GeneralChoice of Value Types in Field Pin
Brady Kelly11-Sep-07 1:38
Brady Kelly11-Sep-07 1:38 
Questionhow to use the distinct-nodes function? Pin
Rocky#11-Sep-07 0:30
Rocky#11-Sep-07 0:30 
Questiongeneralizing the tabular display of xml data Pin
Rocky#10-Sep-07 20:23
Rocky#10-Sep-07 20:23 
QuestionHow to XSL parse 300 mg XML file? Pin
mcsdgal7-Sep-07 8:21
mcsdgal7-Sep-07 8:21 
NewsReding xml node in windows Forms [modified] Pin
chakran6-Sep-07 1:10
chakran6-Sep-07 1:10 
GeneralRe: Reding xml node in windows Forms Pin
Chetan Patel7-Sep-07 2:39
Chetan Patel7-Sep-07 2:39 
AnswerRe: Reding xml node in windows Forms Pin
israr Ali .NET7-Sep-07 2:39
israr Ali .NET7-Sep-07 2:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.