Inserting xml-stylesheet processing instruction not working
Posted: Wed Oct 22, 2008 12:21 am
I am using XSL/T and want to output a 'xml-stylesheet' processing instruction to an XML file. The test code below is not outputting the attributes correctly for the processing instruction but works for the document element.
Any ideas? Am I missing something?
XSL
XSL/T Output
I am using Oxygen 9.3 on Windows XP and Saxon-B 9.0.0.6 for the XSL/T processor.
Any ideas? Am I missing something?
XSL
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:output method="xml" indent="yes" encoding="utf-8" omit-xml-declaration="no"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<xsl:processing-instruction name="xml-stylesheet">
<xsl:attribute name="href">styles1.css</xsl:attribute>
<xsl:attribute name="type">text/css</xsl:attribute>
</xsl:processing-instruction>
<table>
<xsl:attribute name="href">styles2.css</xsl:attribute>
<xsl:attribute name="type">text/css</xsl:attribute>
<xsl:apply-templates select="*"/>
</table>
</xsl:template>
</xsl:stylesheet>
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet styles1.css text/css?><table href="styles2.css" type="text/css"/>