> This appears to be covered by XALANJ-2032, so the following is 
> supplemental info.  The idea is to remove the namespace declarations 
> from the output root element using exclude-result-prefixes as specified 
> in the XSLT 1.0 spec Section 7.1.1.  This problem was produced by 
> XALAN-J 2.7.0.

exclude-result-prefixes only works for namespace declarations that are not 
required in the serialized result tree.  Also, it does not affect 
namespaces copied from the source tree using xsl:copy.

> <?xml version="1.0" encoding="UTF-8"?>
> <root xmlns="http://www.testxsl.org/1999/ournamespace"; 
> xmlns:conf="http://www.testxsl.org/2005/conformance"; version="2.0">
>   <catch>
>    <prompt>fail</prompt><exit/>
>   </catch>
> </root>

Given your input and document and stylesheet, this is the correct result.

> <?xml version="1.0" encoding="UTF-8"?>
> <root version="2.0">
>   <catch>
>    <prompt>fail</prompt><exit/>
>   </catch>
> </root>

If you don't want elements in the namespace "
http://www.testxsl.org/1999/ournamespace";, you can't use xsl:copy.  Also, 
the literal result elements in your stylesheet are in that namespace as 
well, since you have a default namespace in your stylesheet.

For general XSLT questions, I always recommend the Mulberry Technologies 
XSL list, along with the XSL FAQ:

http://www.mulberrytech.com/xsl/
http://www.dpawson.co.uk/xsl/xslfaq.html

Dave

Reply via email to