Unbound xs prefix in result

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Unbound xs prefix in result

Jorge Williams-2
Hello All,

Found a weird regression when moving from Saxon 9.4.0-9 to Saxon 9.7.0-7.  We have XSLTs that process XML Schemas.  After we moved to the latest version of Saxon we found that in some cases the processor would output a result document with an xs prefix that isn’t actually bound to the XMLSchema namespace.

Was able to reproduce with this simple XSLT:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:foo="http://rackspace.com/foo"
    exclude-result-prefixes="xsd foo"
    version="2.0">
   
    <xsl:variable name="elem" as="element()"><element xmlns="http://www.w3.org/2001/XMLSchema"/></xsl:variable>
   
    <xsl:template match="/">
        <xsl:result-document href="foo.xml" exclude-result-prefixes="xsd foo">
          <foo:foo xmlns:xsd="http://www.w3.org/201/XMLSchema">
              <xsl:apply-templates select="$elem" mode="foo"/>
          </foo:foo>
        </xsl:result-document>
    </xsl:template>
   
    <xsl:template match="node()" mode="foo">
        <xsl:copy/>
    </xsl:template>
   
   
</xsl:stylesheet>

The result foo.xml looks like this:

<?xml version="1.0" encoding="UTF-8"?><foo:foo xmlns:xsd="http://www.w3.org/201/XMLSchema" xmlns:foo="http://rackspace.com/foo"><xs:element xmlns="http://www.w3.org/2001/XMLSchema"/></foo:foo>

Notice that the xs prefix is added but not defined, this didn’t happen in older versions.  I know the example above is contrived, but we actually hit those operations in a complex production XSL.

Thanks,

-jOrGe W.

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. http://sdm.link/zohodev2dev
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: Unbound xs prefix in result

Michael Kay
How strange. Many thanks for reporting it. Successfully reproduced, and logged as a bug here:

https://saxonica.plan.io/issues/2872

Please track it there to follow it through to resolution.

Michael Kay
Saxonica

> On 9 Aug 2016, at 23:17, Jorge Williams <[hidden email]> wrote:
>
> Hello All,
>
> Found a weird regression when moving from Saxon 9.4.0-9 to Saxon 9.7.0-7.  We have XSLTs that process XML Schemas.  After we moved to the latest version of Saxon we found that in some cases the processor would output a result document with an xs prefix that isn’t actually bound to the XMLSchema namespace.
>
> Was able to reproduce with this simple XSLT:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>    xmlns:foo="http://rackspace.com/foo"
>    exclude-result-prefixes="xsd foo"
>    version="2.0">
>
>    <xsl:variable name="elem" as="element()"><element xmlns="http://www.w3.org/2001/XMLSchema"/></xsl:variable>
>
>    <xsl:template match="/">
>        <xsl:result-document href="foo.xml" exclude-result-prefixes="xsd foo">
>          <foo:foo xmlns:xsd="http://www.w3.org/201/XMLSchema">
>              <xsl:apply-templates select="$elem" mode="foo"/>
>          </foo:foo>
>        </xsl:result-document>
>    </xsl:template>
>
>    <xsl:template match="node()" mode="foo">
>        <xsl:copy/>
>    </xsl:template>
>
>
> </xsl:stylesheet>
>
> The result foo.xml looks like this:
>
> <?xml version="1.0" encoding="UTF-8"?><foo:foo xmlns:xsd="http://www.w3.org/201/XMLSchema" xmlns:foo="http://rackspace.com/foo"><xs:element xmlns="http://www.w3.org/2001/XMLSchema"/></foo:foo>
>
> Notice that the xs prefix is added but not defined, this didn’t happen in older versions.  I know the example above is contrived, but we actually hit those operations in a complex production XSL.
>
> Thanks,
>
> -jOrGe W.
>
> ------------------------------------------------------------------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity
> planning reports. http://sdm.link/zohodev2dev
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help



------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. http://sdm.link/zohodev2dev
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: Unbound xs prefix in result

Jorge Williams-2
Thanks!

________________________________________
From: Michael Kay <[hidden email]>
Sent: Tuesday, August 9, 2016 6:17 PM
To: Mailing list for the SAXON XSLT and XQuery processor
Subject: Re: [saxon] Unbound xs prefix in result

How strange. Many thanks for reporting it. Successfully reproduced, and logged as a bug here:

https://saxonica.plan.io/issues/2872

Please track it there to follow it through to resolution.

Michael Kay
Saxonica

> On 9 Aug 2016, at 23:17, Jorge Williams <[hidden email]> wrote:
>
> Hello All,
>
> Found a weird regression when moving from Saxon 9.4.0-9 to Saxon 9.7.0-7.  We have XSLTs that process XML Schemas.  After we moved to the latest version of Saxon we found that in some cases the processor would output a result document with an xs prefix that isn’t actually bound to the XMLSchema namespace.
>
> Was able to reproduce with this simple XSLT:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>    xmlns:foo="http://rackspace.com/foo"
>    exclude-result-prefixes="xsd foo"
>    version="2.0">
>
>    <xsl:variable name="elem" as="element()"><element xmlns="http://www.w3.org/2001/XMLSchema"/></xsl:variable>
>
>    <xsl:template match="/">
>        <xsl:result-document href="foo.xml" exclude-result-prefixes="xsd foo">
>          <foo:foo xmlns:xsd="http://www.w3.org/201/XMLSchema">
>              <xsl:apply-templates select="$elem" mode="foo"/>
>          </foo:foo>
>        </xsl:result-document>
>    </xsl:template>
>
>    <xsl:template match="node()" mode="foo">
>        <xsl:copy/>
>    </xsl:template>
>
>
> </xsl:stylesheet>
>
> The result foo.xml looks like this:
>
> <?xml version="1.0" encoding="UTF-8"?><foo:foo xmlns:xsd="http://www.w3.org/201/XMLSchema" xmlns:foo="http://rackspace.com/foo"><xs:element xmlns="http://www.w3.org/2001/XMLSchema"/></foo:foo>
>
> Notice that the xs prefix is added but not defined, this didn’t happen in older versions.  I know the example above is contrived, but we actually hit those operations in a complex production XSL.
>
> Thanks,
>
> -jOrGe W.
>
> ------------------------------------------------------------------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity
> planning reports. http://sdm.link/zohodev2dev
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help



------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. http://sdm.link/zohodev2dev
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. http://sdm.link/zohodev2dev
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help