-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
I discovered two issues with namespace declaration scopes and XPath expressions.
First thing is a missing error, that a namespace is undeclared:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="#all"
version="3.0">
<xsl:output method="xml" indent="yes"/>
<xsl:mode on-no-match="shallow-copy"/>
<xsl:template match="/*" mode="#all">
<out>
<xsl:value-of xmlns:ns1="urn:namespace1" select="@ns1:attr"/>
<xsl:value-of select="@ns1:attr"/><!-- Missing error caused by line above -->
</out>
</xsl:template>
</xsl:stylesheet>
The second thing is an error that must not occur:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="#all"
version="3.0">
<xsl:output method="xml" indent="yes"/>
<xsl:mode on-no-match="shallow-copy"/>
<xsl:template match="/*" mode="#all">
<out>
<!-- False error caused by namespace declaration **following up** the select attribute -->
<xsl:value-of select="@ns1:attr" xmlns:ns1="urn:namespace1"/>
</out>
</xsl:template>
</xsl:stylesheet>
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working