There aren't any literal result elements involved here, therefore neither the namespace declarations in either stylesheet, nor the exclude-result-prefixes declarations in either stylesheet, have any effect on the outcome. Given the way the element is constructed, the only namespaces it acquires are the XML namespace plus the namespaces used in the element name and in its attribute names.

Michael Kay
Saxonica

On 25/02/2013 23:11, Norman Walsh wrote:
Hi,

Consider this stylesheet:

<xsl:stylesheet
  xpath-default-namespace="http://www.example.org/schema/example38"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:fn="http://www.w3.org/2005/xpath-functions"
  xmlns:functx="http://www.functx.com"
  xmlns="http://www.example.org/schema/example38"
  exclude-result-prefixes="functx xsi xs fn "
  version="2.0" >

  <xsl:include href="http://www.xsltfunctions.com/xsl/functx-1.0-nodoc-2007-01.xsl"/>

  <xsl:template match="*:e">
    <xsl:sequence select="functx:change-element-ns-deep(., 'http://www.example.org', '')" />
  </xsl:template>

</xsl:stylesheet>

If you process a document, such as:

  <stuff>
    <e>42</e>
  </stuff>

you get this result with Saxon:

<?xml version="1.0" encoding="UTF-8"?>
  <e xmlns="http://www.example.org">42</e>

I'm confused by that result. In functx-1.0-nodoc-2007-01.xsl, AFAICT,
the element constructed with xsl:element should inherit the fn, local,
and functx namespaces.

I don't think the exclude-result-prefixes in my stylesheet should
remove functx or fn. And I don't see anything that *could* remove
local.

I assume Saxon is right and I'm misreading/misremembering how the spec
works, but I spent some time re-reading the relevant parts and didn't
see how to explain Saxon's answer.

Anyone got a clue-by-four to hit me with?

                                        Be seeing you,
                                          norm



------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb


_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help