You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Sergey Ushakov (JIRA)" <xa...@xml.apache.org> on 2005/06/30 11:22:02 UTC

[jira] Created: (XALANJ-2162) Default namespace corruption on result elements

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


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: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Resolved: (XALANJ-2162) Default namespace corruption on result elements

Posted by "Henry Zongaro (JIRA)" <xa...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XALANJ-2162?page=all ]
     
Henry Zongaro resolved XALANJ-2162:
-----------------------------------

    Fix Version: CurrentCVS
     Resolution: Duplicate

This bug report is a duplicate of XALANJ-1640 which is fixed in CVS.

> 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: CurrentCVS

>
> 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: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Updated: (XALANJ-2162) Default namespace corruption on result elements

Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
     [ 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: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org