A question on the xsl.

Adelard

Usenet Archive
Joined
Dec 15, 2003
Messages
2
Reaction score
0
Here is my xsl and xml, I want the xml node: LABEL3 ( General Information ) to move under the ROW when viewing or printing this PDF Document.

How can I do it?

Thanks

Here is my xsl code:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fox="http://xml.apache.org/fop/extensions"> <xsl:eek:utput method="xml" encoding="UTF-8"/>

<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> <fo:simple-page-master master-name="simple" page-height="8.5in" page-width="11in" margin-top="0.5in" margin-left="0.5in" margin-bottom="0.5in" margin-right="0.5in"> <fo:region-before extent="0in"/> <fo:region-body margin-top="0in" margin-left="0in" margin-bottom="0in" margin-right="0in"/> <fo:region-after border-before-style="solid" border-width="1pt" extent="5mm" display-align="before"/> </fo:simple-page-master> </fo:layout-master-set>

<xsl:apply-templates select="EC-REPORT"/>

</fo:root>
</xsl:template>

<xsl:template match="EC-REPORT">
<fo:page-sequence master-reference="simple">

<fo:static-content flow-name="xsl-region-before"/>
<fo:static-content flow-name="xsl-region-after">
<fo:block text-align="center" font-size="8pt">
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
table-layout="fixed"

<fo:table text-align="center" >
<fo:table-column column-width="3in"/>
<fo:table-column column-width="4in"/>
<fo:table-column column-width="3in"/>

<fo:table-body>

<fo:table-row>
<fo:table-cell>
</fo:table-cell>
<fo:table-cell>
<fo:block line-height="19pt"
font-weight="bold" font-size="10pt" text-align="center"> <xsl:value-of select="TITLE-HEADER/CENTER/LABEL1"/> </fo:block> </fo:table-cell>

</fo:table-row>

<fo:table-row>

<fo:table-cell>
</fo:table-cell>
<fo:table-cell>
<fo:block line-height="19pt"
font-weight="bold" font-size="10pt" text-align="center"> <xsl:value-of select="TITLE-HEADER/CENTER/LABEL2"/> </fo:block> </fo:table-cell> </fo:table-row>

<fo:table-row>
<fo:table-cell>
<fo:block line-height="19pt"
font-weight="bold" font-size="12pt" text-align="left">
<xsl:value-of select="TITLE-HEADER/LEFT/LABEL3"/>
</fo:block>
</fo:table-cell>
<fo:table-cell>
</fo:table-cell>
</fo:table-row>

</fo:table-body>

</fo:table>

<xsl:apply-templates/>

</fo:flow>
</fo:page-sequence>
</xsl:template>

<xsl:template match="SUB_REPORT">
<xsl:apply-templates select="HEADER"/>
<xsl:apply-templates select="ROW"/>
</xsl:template>

<xsl:template match="HEADER">
<fo:block line-height="15pt" font-size="10pt"
space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always"> <fo:inline white-space-collapse="false"/> </fo:block>

<fo:table text-align="center" table-layout="fixed">
<fo:table-column column-width="0.5in"/>
<fo:table-column column-width="0.9in"/>

<fo:table-body>

<fo:table-row>

<fo:table-cell border-bottom-width="thin"
border-bottom-style="double" border-bottom-color="#000000" background-color="#FFFFFF"> <fo:block line-height="11pt" color="#000000" font-size="8pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always" text-align="center" wrap-option='wrap' overflow='auto'> <xsl:value-of select="PART-NAME-"/> </fo:block> </fo:table-cell>

<fo:table-cell border-bottom-width="thin"
border-bottom-style="double" border-bottom-color="#000000" background-color="#FFFFFF"> <fo:block line-height="11pt" color="#000000" font-size="8pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always" text-align="center" wrap-option='wrap' overflow='auto'> <xsl:value-of select="PART-REVISION-"/> </fo:block> </fo:table-cell>

</fo:table-row>
</fo:table-body>
</fo:table>
</xsl:template>

<xsl:template match="ROW">
<fo:table text-align="left" table-layout="fixed">
<fo:table-column column-width="0.5in"/>
<fo:table-column column-width="0.9in"/>

<fo:table-body>

<fo:table-row>

<fo:table-cell>
<fo:block line-height="11pt" color="#000000" font-size="8pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always" text-align="left" wrap-option='wrap' overflow='auto'> <xsl:value-of select="PART-NAME-"/> </fo:block> </fo:table-cell>

<fo:table-cell>
<fo:block line-height="11pt" color="#000000" font-size="8pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always" text-align="left" wrap-option='wrap' overflow='auto'> <xsl:value-of select="PART-REVISION-"/> </fo:block> </fo:table-cell>

</fo:table-row>

</fo:table-body>
</fo:table>
</xsl:template>

</xsl:stylesheet>

Here is my xml below:

<?xml version="1.0" encoding="UTF-8"?>
<EC-REPORT>
<TITLE-HEADER>
<CENTER>
<LABEL1>ROCKWELL COLLINS, INC.</LABEL1>
</CENTER>
<CENTER>
<LABEL2>ENGINEERING CHANGE ORDER (ECO)-</LABEL2>
</CENTER>
<LEFT>
<LABEL3>GENERAL INFORMATION</LABEL3>
</LEFT>

</TITLE-HEADER>
<REPORT>
<SUB-REPORT>
<HEADER>
<PART-NAME->Part Name </PART-NAME->
<PART-REVISION->Part Revision
</PART-REVISION->

</HEADER>
<ROW>
<PART-NAME->ASE</PART-NAME->
<PART-REVISION->A</PART-REVISION->

</ROW>
<ROW>
<PART-NAME->asoo</PART-NAME->
<PART-REVISION->A</PART-REVISION->

</ROW>

</SUB-REPORT>
</REPORT>
</EC-REPORT>
 

Baldo

Usenet Archive
Joined
Dec 3, 2003
Messages
12
Reaction score
0
<EC-REPORT>
<TITLE-HEADER>
<CENTER>
<LABEL1>ROCKWELL COLLINS, INC.</LABEL1>
</CENTER>
<CENTER>
<LABEL2>ENGINEERING CHANGE ORDER (ECO)-</LABEL2>
</CENTER>
<LEFT>
<LABEL3>GENERAL INFORMATION</LABEL3>
</LEFT>

</TITLE-HEADER>
<REPORT>
<SUB-REPORT>
<HEADER>
<PART-NAME->Part Name </PART-NAME->
<PART-REVISION->Part Revision
</PART-REVISION->

</HEADER>
<ROW>
<PART-NAME->ASE</PART-NAME->
<PART-REVISION->A</PART-REVISION->

</ROW>
<ROW>
<PART-NAME->asoo</PART-NAME->
<PART-REVISION->A</PART-REVISION->

</ROW>

</SUB-REPORT>
</REPORT>
</EC-REPORT>

xsl:copy-of select="EC-REPORT/REPORT/SUB-REPORT/ROW[position=1]/PART-NAME" xsl:copy-of select="EC-REPORT/REPORT/SUB-REPORT/ROW[position=1]/PART-REVISION" xsl:copy-of select="EC-REPORT/TITLE-HEADER/LEFT/LABEL3"

is that u want?
 

Adelard

Usenet Archive
Joined
Dec 15, 2003
Messages
2
Reaction score
0
<?xml version="1.0" encoding="UTF-8"?>
<EC-REPORT>
<TITLE-HEADER>
<CENTER>
<LABEL1>ROCKWELL COLLINS, INC.</LABEL1>
</CENTER>
<CENTER>
<LABEL2>ENGINEERING CHANGE ORDER (ECO)-</LABEL2>
</CENTER>
<LEFT>
<LABEL3>GENERAL INFORMATION</LABEL3>
</LEFT>

</TITLE-HEADER>
<REPORT>
<SUB-REPORT>
<HEADER>
<PART-NAME->Part Name </PART-NAME->
<PART-REVISION->Part Revision
</PART-REVISION->

</HEADER>
<ROW>
<PART-NAME->ASE</PART-NAME->
<PART-REVISION->A</PART-REVISION->

</ROW>
<ROW>
<PART-NAME->asoo</PART-NAME->
<PART-REVISION->A</PART-REVISION->

</ROW>

</SUB-REPORT>
</REPORT>
</EC-REPORT>

xsl:copy-of select="EC-REPORT/REPORT/SUB-REPORT/ROW[position=1]/PART-NAME" xsl:copy-of select="EC-REPORT/REPORT/SUB-REPORT/ROW[position=1]/PART-REVISION" xsl:copy-of select="EC-REPORT/TITLE-HEADER/LEFT/LABEL3"

is that u want?

Hi Baldo,

When I view or print the PDF Document, the node LABEL3 should come below the HEADER and ROW. Currently, "GENERAL INFORMATION" of the node LABEL3 comes above the HEADER, if you use my current xsl and xml to view or print the PDF Document.

In brief, I want to customize my xsl to reflect that.

Thanks
Adelard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,042
Messages
3,104,224
Members
248,132
Latest member
henrywalsh

Latest Threads

Top