xsl-list
[Top] [All Lists]

Re: Help with a XML transformation

2005-08-01 12:52:10
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>


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>