[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Help with a XML transformation
Hi Jimmy,
I would like to convert the report in whatever, HTML, DOC, PDF, spreadsheet etc.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>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|