A question on the xsl.

Discussion in 'XML' started by Adelard, Dec 15, 2003.

  1. Adelard

    Adelard Guest

    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>
     
    Adelard, Dec 15, 2003
    #1
    1. Advertising

  2. Adelard

    Baldo Guest

    > <?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?
     
    Baldo, Dec 16, 2003
    #2
    1. Advertising

  3. Adelard

    Adelard Guest

    (Baldo) wrote in message news:<>...
    > > <?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
     
    Adelard, Dec 16, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Flood
    Replies:
    0
    Views:
    1,053
    Kevin Flood
    Sep 8, 2004
  2. Kevin Flood
    Replies:
    1
    Views:
    2,816
    Kevin Flood
    Sep 13, 2004
  3. Klaus Friese
    Replies:
    0
    Views:
    494
    Klaus Friese
    Nov 22, 2004
  4. Vijay singh
    Replies:
    1
    Views:
    453
    Martin Honnen
    Nov 4, 2004
  5. Replies:
    1
    Views:
    3,690
    A. Bolmarcich
    May 27, 2005
Loading...

Share This Page