[xslt] extension-element-prefixes and exclude-result-prefixes




Hi,

There are problems with extension-element-prefixes and
exclude-result-prefixes.

First, extension-element-prefixes is processed only in xsl:stylesheet.
Then, extension prefixes are not excluded from the result tree.

exclude-result-prefixes suffers almost the same problems.
It seems to be recognized for each XSLT construct -- while it should only
be in xsl:stylesheet/xsl:transform -- but not in literal result element.

The attached test case illustrates this:
 · baz is stripped as expected
 · The foo namespace declaration should be stripped by
extension-element-prefixes.
 · As we know it's not done, we test xsl:exclude-result prefixes with the
same namespace.
 · exclude-result-prefixes on xsl:template should generate an error

Tom.
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:foo="http://foo.com"
    xmlns:bar="http://bar.com"
    xmlns:baz="http://baz.com"
    extension-element-prefixes="foo"
    exclude-result-prefixes="baz">

<!--
  Expected: error, xsl:template doesn't allow such an attribute
  Result:   stripped
-->
<xsl:template match="/" exclude-result-prefixes="bar">
  <!--
    Expected: stripped by extension-element-prefixes
    Result:   not stripped
  -->
  <out/>
  <!--
    Expected: stripped by xsl:exclude-result-prefixes
    Result:   not stripped
  -->
  <out xsl:exclude-result-prefixes="foo"/>
</xsl:template>
</xsl:stylesheet>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]