Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[xsl] saxon:output doctype inherits xsl:output doctype

From: "Bob Stayton" <bobs@------------>
To:
Date: 10/3/2006 12:25:00 AM
Perhaps this has come up before, but I couldn't find it in the archives.



I have an XSL stylesheet that I'm processing with Saxon 6.5.5.  It's 
xsl:output includes doctype-public and doctype-system to generate XHTML 
output with a correct DOCTYPE declaration.  In the stylesheet I'm also 
using the extension element saxon:output to generate a separate XML file 
that is not XHTML, and should actually have no DOCTYPE declaration because 
it is intended to be used as a system entity file.



I have found that saxon:output seems to inherit the doctype-public and 
doctype-system from the xsl:output element.  If my separate file had its 
own doctype, I could override those by specifying the attributes on 
saxon:output.  But I need to it to have no DOCTYPE.  I've tried every 
combination I could think of, but I can't turn off the inherited 
doctype-public and doctype-system inherited from the xsl:output element of 
the stylesheet.



Here is a boiled down stylesheet:



<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
               xmlns:saxon="http://icl.com/saxon"
               extension-element-prefixes="saxon"
               exclude-result-prefixes="saxon"
               version="1.0">

<xsl:output method="xml" doctype-public="FOO" doctype-system="BAR"/>



<xsl:template match="/*">
 <section>
   <xsl:apply-templates/>
 </section>
 <saxon:output href="side.out">
   <appendix>
     <xsl:apply-templates/>
   </appendix>
 </saxon:output>
</xsl:template>

</xsl:stylesheet>



With this small sample input file:



<?xml version="1.0"?>
<text>Some text</text>

The main output file has the doctypes from xsl:output:



<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE section
 PUBLIC "FOO" "BAR">
<section>Some text</section>

The side.out output file also has these doctypes:



<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE appendix
 PUBLIC "FOO" "BAR">
<appendix>Some text</appendix>

If I change the stylesheet to use:



<saxon:output href="side.out" doctype-public="" doctype-system="">



Then the side.out contains:



<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE appendix
 PUBLIC "" "">
<appendix>Some text</appendix>

Is there any way to tell saxon:output to not inherit from xsl:output?



Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@xxxxxxxxxxxx


transparent
Print
Mail
Digg
delicious
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