I take your point about the Mulberry Technology list, but since you were gracious enough to respond, I'd like to follow up. The point you made below about exclude-result-prefixes is exactly my question. See inline.

[EMAIL PROTECTED] wrote:
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.

The conf: elements are "meta-elements" that are expanded by the stylesheet. There are NO conf: elements in the result tree and as such, the xmlns:conf declaration is not required at the root element of the result tree. This was exactly what I was hoping exclude-result-prefixes would eliminate, and it doesn't appear to. It is harmless if the default xlmns declaration is placed on the output root element since the entire output tree is in a single (the default) namespace, but it would be nice if exclude-result-prefixes="#default" actually had that effect, as appears to be suggested by XSLT 1.0 7.1.1 xsl:copy is used in order for the stylesheet to be insensitive to the elements of the input document other than the conf: elements.

If you feel my argument has flaws, could you indicate how the desired result can be achieved

Dan


<?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