[ http://issues.apache.org/jira/browse/XALANJ-2162?page=all ]
Brian Minchau updated XALANJ-2162:
----------------------------------
Fix Version: 2.7
(was: CurrentCVS)
> Default namespace corruption on result elements
> -----------------------------------------------
>
> Key: XALANJ-2162
> URL: http://issues.apache.org/jira/browse/XALANJ-2162
> Project: XalanJ2
> Type: Bug
> Versions: 2.6
> Environment: Observed on Win32, JRE 1.5
> Reporter: Sergey Ushakov
> Fix For: 2.7
>
> Some specific combinations of XSLT/XPath constructs may lead to default
> namespace corruption on result elements:
> - excessive default namespace redeclaration on nested elements that
> duplicates the top-level default namespace declaration;
> - unexpected default namespace undeclaration on result elements that _follow_
> the result nodes that show the first problem.
> Sample source XML file:
> -----------------------
> <?xml version="1.0" encoding="UTF-8" ?>
> <s:some-root xmlns:s="urn:some-source-namespace">
> <s:p>qqq</s:p>
> </s:some-root>
> Sample XSLT file:
> -----------------
> <?xml version="1.0" encoding="windows-1251" ?>
> <xsl:transform version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:s="urn:some-source-namespace"
> xmlns:t="urn:some-target-namespace"
> xmlns="http://www.w3.org/1999/xhtml"
> exclude-result-prefixes="s"
> >
> <xsl:output method="xml" indent="yes" />
> <xsl:template match="/">
> <t:root>
> <t:child-1>
> <xsl:variable name="accum0" />
> <xsl:variable name="this-chain">
> <xsl:for-each select="/s:some-root/s:p[1]/node()"> <!-- important:
> for-each ! -->
> <xsl:value-of select="." />
> </xsl:for-each>
> </xsl:variable>
> <xsl:variable name="accum">
> <xsl:copy-of select="$accum0" /> <!-- important: copy-of ! -->
> </xsl:variable>
> <xsl:variable name="last-chain" select="$this-chain" />
> <ul>
> <xsl:copy-of select="$accum" />
> <xsl:if test="$last-chain">
> <li><xsl:copy-of select="$last-chain" /> <!-- important: copy-of
> ! --></li>
> </xsl:if>
> </ul>
> </t:child-1>
> <t:child-2>
> <p>www</p>
> </t:child-2>
> </t:root>
> </xsl:template>
> </xsl:transform>
> Resulting XML file:
> -------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <t:root xmlns:t="urn:some-target-namespace"
> xmlns="http://www.w3.org/1999/xhtml">
> <t:child-1>
> <ul><li xmlns="http://www.w3.org/1999/xhtml">qqq</li>
> </ul>
> </t:child-1>
> <t:child-2 xmlns="">
> <p>www</p>
> </t:child-2>
> </t:root>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]