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

Re: Help with a XML transformation

Subject: Re: Help with a XML transformation
From: "Juergen" <xsl@xxxxxxxxxxxxxxx>
Date: Mon, 1 Aug 2005 21:52:10 +0200
xml to html help
Hi Jimmy,

I would like to convert the report in whatever, HTML, DOC, PDF, spreadsheet etc.
The issue is that I need to be able to exploit it.
just add the following line at the top of the xml and save the stylesheet as PTPierrea4.xsl in the same directory.
<?xml-stylesheet type="text/xsl" href="PTPIERREA4.xsl"?>


Now doubleclick on the xml-file.

Cheers,

Juergen

Here comes the stylesheet.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">


   <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"
        doctype-public="-//W3C//DTD HTML 4.01//EN"
        doctype-system="http://www.w3.org/TR/html4/strict.dtd" />

<xsl:template match = "/">
 <xsl:element name="html" >
   <xsl:element name="head">
     <xsl:element name="title">Applications</xsl:element>
   </xsl:element>
   <xsl:element name="body">
     <xsl:element name="div">
       <xsl:element name="h2">Applications</xsl:element>
       <xsl:element name="table">
         <xsl:attribute name="bgcolor">#cccccc</xsl:attribute>
         <xsl:element name="th">Id</xsl:element>
         <xsl:element name="th">Name</xsl:element>
         <xsl:element name="th">Version</xsl:element>
         <xsl:element name="th">Vendor</xsl:element>
         <xsl:element name="th">Language</xsl:element>
         <xsl:element name="th">#Machine</xsl:element>
         <xsl:element name="th">#Issue</xsl:element>
         <xsl:element name="th">#Solution</xsl:element>
         <xsl:apply-templates select="NewDataSet/Table1" />
       </xsl:element>
     </xsl:element>
   </xsl:element>
 </xsl:element>
</xsl:template>

<xsl:template match="Table1">
<xsl:element name="tr">
<xsl:attribute name="bgcolor">#f8f8f8</xsl:attribute>
<xsl:element name="td"><xsl:value-of select="applicationId"/></xsl:element>
<xsl:element name="td"><xsl:value-of select="appName"/></xsl:element>
<xsl:element name="td"><xsl:value-of select="appVersion"/></xsl:element>
<xsl:element name="td"><xsl:value-of select="appVendorName"/></xsl:element>
<xsl:element name="td"><xsl:value-of select="appLanguage"/></xsl:element>
<xsl:element name="td"><xsl:value-of select="machineCount"/></xsl:element>
<xsl:element name="td"><xsl:value-of select="issueCount"/></xsl:element>
<xsl:element name="td"><xsl:value-of select="solutionCount"/></xsl:element>
</xsl:element>
</xsl:template>


</xsl:stylesheet>

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.