Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] Help with a XML transformation

From: "Juergen" <xsl@--------------->
To:
Date: 8/1/2005 7:52:00 PM
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>


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent