[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XSLT element usage on textual outut

Subject: XSLT element usage on textual outut
From: "Albert Tsun" <albert.tsun@xxxxxxxxxxxx>
Date: Fri, 20 Oct 2000 13:57:23 +0800
outut

Hi all,

I am trying to produce a textual report from a XML data source and using
XSLT with Xalan.
I have some of the formatting problems when writing the XSL stylesheet,
please advise and help.

XML data source:

<Report>
     <Header>
          <Title> Sales Report </Title>
     </Header>
     <SalesRec>
          <ID>0001</ID>
          <Code>AC001</Code>
          <Name>Product A</Name>
          <Qty>10000</Qty>
          <Cost>10000.00</Cost>
     </SalesRec>
     <SalesRec>
          <ID>0002</ID>
          <Code>BC001</Code>
          <Name>Product B</Name>
          <Qty>10000</Qty>
          <Cost>10000.00</Cost>
     </SalesRec>
     <SalesRec>
          <ID>0003</ID>
          <Code>CC001</Code>
          <Name>Product C</Name>
          <Qty>10000</Qty>
          <Cost>10000.00</Cost>
     </SalesRec>
     <Footer>**** End of Report ****</Footer>
</Report>


Expected Textual Output:

               Sales Report              ID: 0001
-----------------------------------------------------------------------
Code : AC001        Name : Product A
Qty : 10000
Cost : 100000.00

<page break>
               Sales Report              ID: 0002
-----------------------------------------------------------------------
Code : AC001        Name : Product B
Qty : 10000
Cost : 100000.00

<page break>
               Sales Report              ID: 0003
-----------------------------------------------------------------------
Code : CC001        Name : Product C
Qty : 10000
Cost : 100000.00

     **** End of Report ****


XSL stylesheet:

<xsl:stylesheet>
     <xsl:template match="/">
          <xsl:apply-template select="*"/>
     </xsl:template>

     <xsl:tempate match="Header">
          <!--- Q1. How to copy "title" text element in variable and can be
reused to "SalesRec" template,
          please give sample code -->
          .......
          .......
     </xsl:template>

     <xsl:template match="SalesRec">
          <!-- Q2. How to use stored "title" text in Header, please give
sample code-->
          <!-- Q3. How to insert page break char -->
          .......
          .......
     </xsl:template>

     <xsl:template match="Footer">
          <xsl:value-of select="."/>
     </xsl:template>

</xsl:stylesheet>

Thanks in advance.
Albert Tsun
Excel Techology Int.  (HK) Ltd





 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.