You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Mike Brown (JIRA)" <xa...@xml.apache.org> on 2006/11/08 17:18:53 UTC

[jira] Created: (XALANJ-2334) Namespace nodes are generated for empty namespace

Namespace nodes are generated for empty namespace
-------------------------------------------------

                 Key: XALANJ-2334
                 URL: http://issues.apache.org/jira/browse/XALANJ-2334
             Project: XalanJ2
          Issue Type: Bug
          Components: Xalan
    Affects Versions: 2.7
            Reporter: Mike Brown
            Priority: Minor


When elements in the empty namespace (no namespace) are descendants of nodes in some other unprefixed namespace, in Xalan is reporting namespace nodes for the default, empty namespace -- i.e., it is saying there are namespace nodes that have an empty string-value and empty local-name corresponding to xmlns="".

The first paragraph of XPath 1.0 section 5.4 and the behavior of other processors indicates such nodes are not part of the XPath data model. That is, it is impossible to have a namespace node whose string-value is an empty string; namespace nodes only indicate what *non-empty* namespaces are in scope.

The presence of the extra nodes is redundant; it's implicit that the element is in no namespace if it has no namespace nodes with an empty local-name.

The following example demonstrates. The stylesheet serializes the 'e' elements, showing their namespace node information. Elements 1-4 have extraneous namespace nodes. The others are fine.

xmlns.xml
==========
<data>

  <group xmlns="http://example.com/foo">

    <!--e elements in empty namespace, ancestors in non-empty namespace-->
    <group xmlns="">
      <e>one</e>
      <e>two</e>
      <group>
        <e>three</e>
        <e>four</e>
      </group>
    </group>

    <!--e elements in same non-empty namespace as ancestor-->
    <group>
      <e>five</e>
      <group>
        <e>six</e>
      </group>
    </group>
  </group>

  <!--e elements and ancestors in non-empty namespace-->
  <group>
    <e>seven</e>
  </group>

</data>

xmlns.xsl
==========
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output method="xml" indent="yes"/>

  <xsl:template match="/">
    <xsl:apply-templates select="//*[local-name()='e']"/>
  </xsl:template>

  <xsl:template match="*[local-name()='e']">
    <Element content="{.}">
      <xsl:for-each select="namespace::*">
        <Namespace prefix="{local-name()}">
          <xsl:value-of select="."/>
        </Namespace>
      </xsl:for-each>
    </Element>
  </xsl:template>

</xsl:stylesheet>

expected
=========
<?xml version="1.0" encoding="UTF-8"?>
<Element content="one">
<Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
</Element>
<Element content="two">
<Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
</Element>
<Element content="three">
<Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
</Element>
<Element content="four">
<Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
</Element>
<Element content="five">
<Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
<Namespace prefix="">http://example.com/foo</Namespace>
</Element>
<Element content="six">
<Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
<Namespace prefix="">http://example.com/foo</Namespace>
</Element>
<Element content="seven">
<Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
</Element>

actual (with Xalan-J 2.7.0)
=======================
<?xml version="1.0" encoding="UTF-8"?>
<Element content="one">
<Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
<Namespace prefix=""/>
</Element>
<Element content="two">
<Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
<Namespace prefix=""/>
</Element>
<Element content="three">
<Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
<Namespace prefix=""/>
</Element>
<Element content="four">
<Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
<Namespace prefix=""/>
</Element>
<Element content="five">
<Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
<Namespace prefix="">http://example.com/foo</Namespace>
</Element>
<Element content="six">
<Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
<Namespace prefix="">http://example.com/foo</Namespace>
</Element>
<Element content="seven">
<Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
</Element>


I have a real-world stylesheet that serializes elements as character data, in XML syntax, in an HTML textarea. I rely on the namespace axis to faithfully report what namespaces are in scope. I'd like to not have to go out of my way to ignore extra namespace nodes in this one XSLT processor.

Thanks for considering this issue.


-- 
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] Commented: (XALANJ-2334) Namespace nodes are generated for empty namespace

Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470679 ] 

Brian Minchau commented on XALANJ-2334:
---------------------------------------

Per the JIRA triage meeting on Feburary 5, 2007, Dave Marston agreed to review
Kevin's testcase and see if it is a conformance test and could be added to
an appropriate test bucket.

Dave's (and others) suspicion is that these extra namespace nodes should not
exist at all and that the testcase is really a conformance issue and not an
acceptance issue.


> Namespace nodes are generated for empty namespace
> -------------------------------------------------
>
>                 Key: XALANJ-2334
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2334
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: Xalan
>    Affects Versions: 2.7
>            Reporter: Mike Brown
>            Priority: Minor
>             Fix For: The Latest Development Code
>
>         Attachments: xalan2334-tests.patch, xmlns.xml, xmlns.xsl
>
>
> When elements in the empty namespace (no namespace) are descendants of nodes in some other unprefixed namespace, in Xalan is reporting namespace nodes for the default, empty namespace -- i.e., it is saying there are namespace nodes that have an empty string-value and empty local-name corresponding to xmlns="".
> The first paragraph of XPath 1.0 section 5.4 and the behavior of other processors indicates such nodes are not part of the XPath data model. That is, it is impossible to have a namespace node whose string-value is an empty string; namespace nodes only indicate what *non-empty* namespaces are in scope.
> The presence of the extra nodes is redundant; it's implicit that the element is in no namespace if it has no namespace nodes with an empty local-name.
> The following example demonstrates. The stylesheet serializes the 'e' elements, showing their namespace node information. Elements 1-4 have extraneous namespace nodes. The others are fine.
> xmlns.xml
> ==========
> <data>
>   <group xmlns="http://example.com/foo">
>     <!--e elements in empty namespace, ancestors in non-empty namespace-->
>     <group xmlns="">
>       <e>one</e>
>       <e>two</e>
>       <group>
>         <e>three</e>
>         <e>four</e>
>       </group>
>     </group>
>     <!--e elements in same non-empty namespace as ancestor-->
>     <group>
>       <e>five</e>
>       <group>
>         <e>six</e>
>       </group>
>     </group>
>   </group>
>   <!--e elements and ancestors in non-empty namespace-->
>   <group>
>     <e>seven</e>
>   </group>
> </data>
> xmlns.xsl
> ==========
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>   <xsl:output method="xml" indent="yes"/>
>   <xsl:template match="/">
>     <xsl:apply-templates select="//*[local-name()='e']"/>
>   </xsl:template>
>   <xsl:template match="*[local-name()='e']">
>     <Element content="{.}">
>       <xsl:for-each select="namespace::*">
>         <Namespace prefix="{local-name()}">
>           <xsl:value-of select="."/>
>         </Namespace>
>       </xsl:for-each>
>     </Element>
>   </xsl:template>
> </xsl:stylesheet>
> expected
> =========
> <?xml version="1.0" encoding="UTF-8"?>
> <Element content="one">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> <Element content="two">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> <Element content="three">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> <Element content="four">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> <Element content="five">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix="">http://example.com/foo</Namespace>
> </Element>
> <Element content="six">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix="">http://example.com/foo</Namespace>
> </Element>
> <Element content="seven">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> actual (with Xalan-J 2.7.0)
> =======================
> <?xml version="1.0" encoding="UTF-8"?>
> <Element content="one">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix=""/>
> </Element>
> <Element content="two">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix=""/>
> </Element>
> <Element content="three">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix=""/>
> </Element>
> <Element content="four">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix=""/>
> </Element>
> <Element content="five">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix="">http://example.com/foo</Namespace>
> </Element>
> <Element content="six">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix="">http://example.com/foo</Namespace>
> </Element>
> <Element content="seven">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> I have a real-world stylesheet that serializes elements as character data, in XML syntax, in an HTML textarea. I rely on the namespace axis to faithfully report what namespaces are in scope. I'd like to not have to go out of my way to ignore extra namespace nodes in this one XSLT processor.
> Thanks for considering this issue.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Assigned: (XALANJ-2334) Namespace nodes are generated for empty namespace

Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XALANJ-2334?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Minchau reassigned XALANJ-2334:
-------------------------------------

    Assignee: David Marston

> Namespace nodes are generated for empty namespace
> -------------------------------------------------
>
>                 Key: XALANJ-2334
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2334
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: Xalan
>    Affects Versions: 2.7
>            Reporter: Mike Brown
>         Assigned To: David Marston
>            Priority: Minor
>             Fix For: The Latest Development Code
>
>         Attachments: xalan2334-tests.patch, xmlns.xml, xmlns.xsl
>
>
> When elements in the empty namespace (no namespace) are descendants of nodes in some other unprefixed namespace, in Xalan is reporting namespace nodes for the default, empty namespace -- i.e., it is saying there are namespace nodes that have an empty string-value and empty local-name corresponding to xmlns="".
> The first paragraph of XPath 1.0 section 5.4 and the behavior of other processors indicates such nodes are not part of the XPath data model. That is, it is impossible to have a namespace node whose string-value is an empty string; namespace nodes only indicate what *non-empty* namespaces are in scope.
> The presence of the extra nodes is redundant; it's implicit that the element is in no namespace if it has no namespace nodes with an empty local-name.
> The following example demonstrates. The stylesheet serializes the 'e' elements, showing their namespace node information. Elements 1-4 have extraneous namespace nodes. The others are fine.
> xmlns.xml
> ==========
> <data>
>   <group xmlns="http://example.com/foo">
>     <!--e elements in empty namespace, ancestors in non-empty namespace-->
>     <group xmlns="">
>       <e>one</e>
>       <e>two</e>
>       <group>
>         <e>three</e>
>         <e>four</e>
>       </group>
>     </group>
>     <!--e elements in same non-empty namespace as ancestor-->
>     <group>
>       <e>five</e>
>       <group>
>         <e>six</e>
>       </group>
>     </group>
>   </group>
>   <!--e elements and ancestors in non-empty namespace-->
>   <group>
>     <e>seven</e>
>   </group>
> </data>
> xmlns.xsl
> ==========
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>   <xsl:output method="xml" indent="yes"/>
>   <xsl:template match="/">
>     <xsl:apply-templates select="//*[local-name()='e']"/>
>   </xsl:template>
>   <xsl:template match="*[local-name()='e']">
>     <Element content="{.}">
>       <xsl:for-each select="namespace::*">
>         <Namespace prefix="{local-name()}">
>           <xsl:value-of select="."/>
>         </Namespace>
>       </xsl:for-each>
>     </Element>
>   </xsl:template>
> </xsl:stylesheet>
> expected
> =========
> <?xml version="1.0" encoding="UTF-8"?>
> <Element content="one">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> <Element content="two">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> <Element content="three">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> <Element content="four">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> <Element content="five">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix="">http://example.com/foo</Namespace>
> </Element>
> <Element content="six">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix="">http://example.com/foo</Namespace>
> </Element>
> <Element content="seven">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> actual (with Xalan-J 2.7.0)
> =======================
> <?xml version="1.0" encoding="UTF-8"?>
> <Element content="one">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix=""/>
> </Element>
> <Element content="two">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix=""/>
> </Element>
> <Element content="three">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix=""/>
> </Element>
> <Element content="four">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix=""/>
> </Element>
> <Element content="five">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix="">http://example.com/foo</Namespace>
> </Element>
> <Element content="six">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix="">http://example.com/foo</Namespace>
> </Element>
> <Element content="seven">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> I have a real-world stylesheet that serializes elements as character data, in XML syntax, in an HTML textarea. I rely on the namespace axis to faithfully report what namespaces are in scope. I'd like to not have to go out of my way to ignore extra namespace nodes in this one XSLT processor.
> Thanks for considering this issue.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Resolved: (XALANJ-2334) Namespace nodes are generated for empty namespace

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

Brian Minchau resolved XALANJ-2334.
-----------------------------------

    Fix Version/s: The Latest Development Code
       Resolution: Duplicate

This issue covers the default namespace and is XML 1.0 related,
however XALANJ-2150 already includes this problem about the default namespace as well as 
non-default namespaces.  A few testcases should come out of both issues.

> Namespace nodes are generated for empty namespace
> -------------------------------------------------
>
>                 Key: XALANJ-2334
>                 URL: http://issues.apache.org/jira/browse/XALANJ-2334
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: Xalan
>    Affects Versions: 2.7
>            Reporter: Mike Brown
>            Priority: Minor
>             Fix For: The Latest Development Code
>
>         Attachments: xmlns.xml, xmlns.xsl
>
>
> When elements in the empty namespace (no namespace) are descendants of nodes in some other unprefixed namespace, in Xalan is reporting namespace nodes for the default, empty namespace -- i.e., it is saying there are namespace nodes that have an empty string-value and empty local-name corresponding to xmlns="".
> The first paragraph of XPath 1.0 section 5.4 and the behavior of other processors indicates such nodes are not part of the XPath data model. That is, it is impossible to have a namespace node whose string-value is an empty string; namespace nodes only indicate what *non-empty* namespaces are in scope.
> The presence of the extra nodes is redundant; it's implicit that the element is in no namespace if it has no namespace nodes with an empty local-name.
> The following example demonstrates. The stylesheet serializes the 'e' elements, showing their namespace node information. Elements 1-4 have extraneous namespace nodes. The others are fine.
> xmlns.xml
> ==========
> <data>
>   <group xmlns="http://example.com/foo">
>     <!--e elements in empty namespace, ancestors in non-empty namespace-->
>     <group xmlns="">
>       <e>one</e>
>       <e>two</e>
>       <group>
>         <e>three</e>
>         <e>four</e>
>       </group>
>     </group>
>     <!--e elements in same non-empty namespace as ancestor-->
>     <group>
>       <e>five</e>
>       <group>
>         <e>six</e>
>       </group>
>     </group>
>   </group>
>   <!--e elements and ancestors in non-empty namespace-->
>   <group>
>     <e>seven</e>
>   </group>
> </data>
> xmlns.xsl
> ==========
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>   <xsl:output method="xml" indent="yes"/>
>   <xsl:template match="/">
>     <xsl:apply-templates select="//*[local-name()='e']"/>
>   </xsl:template>
>   <xsl:template match="*[local-name()='e']">
>     <Element content="{.}">
>       <xsl:for-each select="namespace::*">
>         <Namespace prefix="{local-name()}">
>           <xsl:value-of select="."/>
>         </Namespace>
>       </xsl:for-each>
>     </Element>
>   </xsl:template>
> </xsl:stylesheet>
> expected
> =========
> <?xml version="1.0" encoding="UTF-8"?>
> <Element content="one">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> <Element content="two">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> <Element content="three">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> <Element content="four">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> <Element content="five">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix="">http://example.com/foo</Namespace>
> </Element>
> <Element content="six">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix="">http://example.com/foo</Namespace>
> </Element>
> <Element content="seven">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> actual (with Xalan-J 2.7.0)
> =======================
> <?xml version="1.0" encoding="UTF-8"?>
> <Element content="one">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix=""/>
> </Element>
> <Element content="two">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix=""/>
> </Element>
> <Element content="three">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix=""/>
> </Element>
> <Element content="four">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix=""/>
> </Element>
> <Element content="five">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix="">http://example.com/foo</Namespace>
> </Element>
> <Element content="six">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix="">http://example.com/foo</Namespace>
> </Element>
> <Element content="seven">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> I have a real-world stylesheet that serializes elements as character data, in XML syntax, in an HTML textarea. I rely on the namespace axis to faithfully report what namespaces are in scope. I'd like to not have to go out of my way to ignore extra namespace nodes in this one XSLT processor.
> Thanks for considering this issue.

-- 
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] Commented: (XALANJ-2334) Namespace nodes are generated for empty namespace

Posted by "Mike Brown (JIRA)" <xa...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XALANJ-2334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12551215 ] 

Mike Brown commented on XALANJ-2334:
------------------------------------

I'm the originator of this issue, but will not be able to test the fix anytime soon. I'd appreciate it if someone else could verify it on my behalf. Thanks.

> Namespace nodes are generated for empty namespace
> -------------------------------------------------
>
>                 Key: XALANJ-2334
>                 URL: https://issues.apache.org/jira/browse/XALANJ-2334
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: Xalan
>    Affects Versions: 2.7
>            Reporter: Mike Brown
>            Assignee: David Marston
>            Priority: Minor
>             Fix For: 2.7.1
>
>         Attachments: xalan2334-tests.patch, xmlns.xml, xmlns.xsl
>
>
> When elements in the empty namespace (no namespace) are descendants of nodes in some other unprefixed namespace, in Xalan is reporting namespace nodes for the default, empty namespace -- i.e., it is saying there are namespace nodes that have an empty string-value and empty local-name corresponding to xmlns="".
> The first paragraph of XPath 1.0 section 5.4 and the behavior of other processors indicates such nodes are not part of the XPath data model. That is, it is impossible to have a namespace node whose string-value is an empty string; namespace nodes only indicate what *non-empty* namespaces are in scope.
> The presence of the extra nodes is redundant; it's implicit that the element is in no namespace if it has no namespace nodes with an empty local-name.
> The following example demonstrates. The stylesheet serializes the 'e' elements, showing their namespace node information. Elements 1-4 have extraneous namespace nodes. The others are fine.
> xmlns.xml
> ==========
> <data>
>   <group xmlns="http://example.com/foo">
>     <!--e elements in empty namespace, ancestors in non-empty namespace-->
>     <group xmlns="">
>       <e>one</e>
>       <e>two</e>
>       <group>
>         <e>three</e>
>         <e>four</e>
>       </group>
>     </group>
>     <!--e elements in same non-empty namespace as ancestor-->
>     <group>
>       <e>five</e>
>       <group>
>         <e>six</e>
>       </group>
>     </group>
>   </group>
>   <!--e elements and ancestors in non-empty namespace-->
>   <group>
>     <e>seven</e>
>   </group>
> </data>
> xmlns.xsl
> ==========
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>   <xsl:output method="xml" indent="yes"/>
>   <xsl:template match="/">
>     <xsl:apply-templates select="//*[local-name()='e']"/>
>   </xsl:template>
>   <xsl:template match="*[local-name()='e']">
>     <Element content="{.}">
>       <xsl:for-each select="namespace::*">
>         <Namespace prefix="{local-name()}">
>           <xsl:value-of select="."/>
>         </Namespace>
>       </xsl:for-each>
>     </Element>
>   </xsl:template>
> </xsl:stylesheet>
> expected
> =========
> <?xml version="1.0" encoding="UTF-8"?>
> <Element content="one">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> <Element content="two">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> <Element content="three">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> <Element content="four">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> <Element content="five">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix="">http://example.com/foo</Namespace>
> </Element>
> <Element content="six">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix="">http://example.com/foo</Namespace>
> </Element>
> <Element content="seven">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> actual (with Xalan-J 2.7.0)
> =======================
> <?xml version="1.0" encoding="UTF-8"?>
> <Element content="one">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix=""/>
> </Element>
> <Element content="two">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix=""/>
> </Element>
> <Element content="three">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix=""/>
> </Element>
> <Element content="four">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix=""/>
> </Element>
> <Element content="five">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix="">http://example.com/foo</Namespace>
> </Element>
> <Element content="six">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix="">http://example.com/foo</Namespace>
> </Element>
> <Element content="seven">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> I have a real-world stylesheet that serializes elements as character data, in XML syntax, in an HTML textarea. I rely on the namespace axis to faithfully report what namespaces are in scope. I'd like to not have to go out of my way to ignore extra namespace nodes in this one XSLT processor.
> Thanks for considering this issue.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Commented: (XALANJ-2334) Namespace nodes are generated for empty namespace

Posted by "Henry Zongaro (JIRA)" <xa...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XALANJ-2334?page=comments#action_12448237 ] 
            
Henry Zongaro commented on XALANJ-2334:
---------------------------------------

Though that issue refers primarily to XML 1.1., I believe this is the same as the problem described in XALANJ-2150.

> Namespace nodes are generated for empty namespace
> -------------------------------------------------
>
>                 Key: XALANJ-2334
>                 URL: http://issues.apache.org/jira/browse/XALANJ-2334
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: Xalan
>    Affects Versions: 2.7
>            Reporter: Mike Brown
>            Priority: Minor
>         Attachments: xmlns.xml, xmlns.xsl
>
>
> When elements in the empty namespace (no namespace) are descendants of nodes in some other unprefixed namespace, in Xalan is reporting namespace nodes for the default, empty namespace -- i.e., it is saying there are namespace nodes that have an empty string-value and empty local-name corresponding to xmlns="".
> The first paragraph of XPath 1.0 section 5.4 and the behavior of other processors indicates such nodes are not part of the XPath data model. That is, it is impossible to have a namespace node whose string-value is an empty string; namespace nodes only indicate what *non-empty* namespaces are in scope.
> The presence of the extra nodes is redundant; it's implicit that the element is in no namespace if it has no namespace nodes with an empty local-name.
> The following example demonstrates. The stylesheet serializes the 'e' elements, showing their namespace node information. Elements 1-4 have extraneous namespace nodes. The others are fine.
> xmlns.xml
> ==========
> <data>
>   <group xmlns="http://example.com/foo">
>     <!--e elements in empty namespace, ancestors in non-empty namespace-->
>     <group xmlns="">
>       <e>one</e>
>       <e>two</e>
>       <group>
>         <e>three</e>
>         <e>four</e>
>       </group>
>     </group>
>     <!--e elements in same non-empty namespace as ancestor-->
>     <group>
>       <e>five</e>
>       <group>
>         <e>six</e>
>       </group>
>     </group>
>   </group>
>   <!--e elements and ancestors in non-empty namespace-->
>   <group>
>     <e>seven</e>
>   </group>
> </data>
> xmlns.xsl
> ==========
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>   <xsl:output method="xml" indent="yes"/>
>   <xsl:template match="/">
>     <xsl:apply-templates select="//*[local-name()='e']"/>
>   </xsl:template>
>   <xsl:template match="*[local-name()='e']">
>     <Element content="{.}">
>       <xsl:for-each select="namespace::*">
>         <Namespace prefix="{local-name()}">
>           <xsl:value-of select="."/>
>         </Namespace>
>       </xsl:for-each>
>     </Element>
>   </xsl:template>
> </xsl:stylesheet>
> expected
> =========
> <?xml version="1.0" encoding="UTF-8"?>
> <Element content="one">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> <Element content="two">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> <Element content="three">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> <Element content="four">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> <Element content="five">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix="">http://example.com/foo</Namespace>
> </Element>
> <Element content="six">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix="">http://example.com/foo</Namespace>
> </Element>
> <Element content="seven">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> actual (with Xalan-J 2.7.0)
> =======================
> <?xml version="1.0" encoding="UTF-8"?>
> <Element content="one">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix=""/>
> </Element>
> <Element content="two">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix=""/>
> </Element>
> <Element content="three">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix=""/>
> </Element>
> <Element content="four">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix=""/>
> </Element>
> <Element content="five">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix="">http://example.com/foo</Namespace>
> </Element>
> <Element content="six">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix="">http://example.com/foo</Namespace>
> </Element>
> <Element content="seven">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> I have a real-world stylesheet that serializes elements as character data, in XML syntax, in an HTML textarea. I rely on the namespace axis to faithfully report what namespaces are in scope. I'd like to not have to go out of my way to ignore extra namespace nodes in this one XSLT processor.
> Thanks for considering this issue.

-- 
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] Commented: (XALANJ-2334) Namespace nodes are generated for empty namespace

Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XALANJ-2334?page=comments#action_12457511 ] 
            
Brian Minchau commented on XALANJ-2334:
---------------------------------------

>From the Xalan-J bug triage on December 11,2006:
       > Related to 2150. Henry Z. says the DTM contains nodes for namespace
       > undelcaration and those nodes are then found when navigating the 
       > namespace axis.  2334 describes the problem of undeclaration of
       > the default namespace, while 2150 describes the problem of undeclaration
       > of any namespace.
       > Kevin Cormier agreed to create the new testcase for 2334 and 2150
       > ... but testcases that are XML 1.1 related should be in the accept bucket.
       > Dave Marston thinks that we should have an issue to track that
       > some 'namespace' tests should be moved from conformance to acceptance buckets.
       >

> Namespace nodes are generated for empty namespace
> -------------------------------------------------
>
>                 Key: XALANJ-2334
>                 URL: http://issues.apache.org/jira/browse/XALANJ-2334
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: Xalan
>    Affects Versions: 2.7
>            Reporter: Mike Brown
>            Priority: Minor
>         Attachments: xmlns.xml, xmlns.xsl
>
>
> When elements in the empty namespace (no namespace) are descendants of nodes in some other unprefixed namespace, in Xalan is reporting namespace nodes for the default, empty namespace -- i.e., it is saying there are namespace nodes that have an empty string-value and empty local-name corresponding to xmlns="".
> The first paragraph of XPath 1.0 section 5.4 and the behavior of other processors indicates such nodes are not part of the XPath data model. That is, it is impossible to have a namespace node whose string-value is an empty string; namespace nodes only indicate what *non-empty* namespaces are in scope.
> The presence of the extra nodes is redundant; it's implicit that the element is in no namespace if it has no namespace nodes with an empty local-name.
> The following example demonstrates. The stylesheet serializes the 'e' elements, showing their namespace node information. Elements 1-4 have extraneous namespace nodes. The others are fine.
> xmlns.xml
> ==========
> <data>
>   <group xmlns="http://example.com/foo">
>     <!--e elements in empty namespace, ancestors in non-empty namespace-->
>     <group xmlns="">
>       <e>one</e>
>       <e>two</e>
>       <group>
>         <e>three</e>
>         <e>four</e>
>       </group>
>     </group>
>     <!--e elements in same non-empty namespace as ancestor-->
>     <group>
>       <e>five</e>
>       <group>
>         <e>six</e>
>       </group>
>     </group>
>   </group>
>   <!--e elements and ancestors in non-empty namespace-->
>   <group>
>     <e>seven</e>
>   </group>
> </data>
> xmlns.xsl
> ==========
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>   <xsl:output method="xml" indent="yes"/>
>   <xsl:template match="/">
>     <xsl:apply-templates select="//*[local-name()='e']"/>
>   </xsl:template>
>   <xsl:template match="*[local-name()='e']">
>     <Element content="{.}">
>       <xsl:for-each select="namespace::*">
>         <Namespace prefix="{local-name()}">
>           <xsl:value-of select="."/>
>         </Namespace>
>       </xsl:for-each>
>     </Element>
>   </xsl:template>
> </xsl:stylesheet>
> expected
> =========
> <?xml version="1.0" encoding="UTF-8"?>
> <Element content="one">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> <Element content="two">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> <Element content="three">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> <Element content="four">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> <Element content="five">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix="">http://example.com/foo</Namespace>
> </Element>
> <Element content="six">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix="">http://example.com/foo</Namespace>
> </Element>
> <Element content="seven">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> actual (with Xalan-J 2.7.0)
> =======================
> <?xml version="1.0" encoding="UTF-8"?>
> <Element content="one">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix=""/>
> </Element>
> <Element content="two">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix=""/>
> </Element>
> <Element content="three">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix=""/>
> </Element>
> <Element content="four">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix=""/>
> </Element>
> <Element content="five">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix="">http://example.com/foo</Namespace>
> </Element>
> <Element content="six">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix="">http://example.com/foo</Namespace>
> </Element>
> <Element content="seven">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> I have a real-world stylesheet that serializes elements as character data, in XML syntax, in an HTML textarea. I rely on the namespace axis to faithfully report what namespaces are in scope. I'd like to not have to go out of my way to ignore extra namespace nodes in this one XSLT processor.
> Thanks for considering this issue.

-- 
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] Commented: (XALANJ-2334) Namespace nodes are generated for empty namespace

Posted by "David Marston (JIRA)" <xa...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XALANJ-2334?page=comments#action_12448845 ] 
            
David Marston commented on XALANJ-2334:
---------------------------------------

I agree with Mike's reading of section 5.4 of XPath 1.0.

We should add a test case in the namespace group to test this.

> Namespace nodes are generated for empty namespace
> -------------------------------------------------
>
>                 Key: XALANJ-2334
>                 URL: http://issues.apache.org/jira/browse/XALANJ-2334
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: Xalan
>    Affects Versions: 2.7
>            Reporter: Mike Brown
>            Priority: Minor
>         Attachments: xmlns.xml, xmlns.xsl
>
>
> When elements in the empty namespace (no namespace) are descendants of nodes in some other unprefixed namespace, in Xalan is reporting namespace nodes for the default, empty namespace -- i.e., it is saying there are namespace nodes that have an empty string-value and empty local-name corresponding to xmlns="".
> The first paragraph of XPath 1.0 section 5.4 and the behavior of other processors indicates such nodes are not part of the XPath data model. That is, it is impossible to have a namespace node whose string-value is an empty string; namespace nodes only indicate what *non-empty* namespaces are in scope.
> The presence of the extra nodes is redundant; it's implicit that the element is in no namespace if it has no namespace nodes with an empty local-name.
> The following example demonstrates. The stylesheet serializes the 'e' elements, showing their namespace node information. Elements 1-4 have extraneous namespace nodes. The others are fine.
> xmlns.xml
> ==========
> <data>
>   <group xmlns="http://example.com/foo">
>     <!--e elements in empty namespace, ancestors in non-empty namespace-->
>     <group xmlns="">
>       <e>one</e>
>       <e>two</e>
>       <group>
>         <e>three</e>
>         <e>four</e>
>       </group>
>     </group>
>     <!--e elements in same non-empty namespace as ancestor-->
>     <group>
>       <e>five</e>
>       <group>
>         <e>six</e>
>       </group>
>     </group>
>   </group>
>   <!--e elements and ancestors in non-empty namespace-->
>   <group>
>     <e>seven</e>
>   </group>
> </data>
> xmlns.xsl
> ==========
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>   <xsl:output method="xml" indent="yes"/>
>   <xsl:template match="/">
>     <xsl:apply-templates select="//*[local-name()='e']"/>
>   </xsl:template>
>   <xsl:template match="*[local-name()='e']">
>     <Element content="{.}">
>       <xsl:for-each select="namespace::*">
>         <Namespace prefix="{local-name()}">
>           <xsl:value-of select="."/>
>         </Namespace>
>       </xsl:for-each>
>     </Element>
>   </xsl:template>
> </xsl:stylesheet>
> expected
> =========
> <?xml version="1.0" encoding="UTF-8"?>
> <Element content="one">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> <Element content="two">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> <Element content="three">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> <Element content="four">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> <Element content="five">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix="">http://example.com/foo</Namespace>
> </Element>
> <Element content="six">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix="">http://example.com/foo</Namespace>
> </Element>
> <Element content="seven">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> actual (with Xalan-J 2.7.0)
> =======================
> <?xml version="1.0" encoding="UTF-8"?>
> <Element content="one">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix=""/>
> </Element>
> <Element content="two">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix=""/>
> </Element>
> <Element content="three">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix=""/>
> </Element>
> <Element content="four">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix=""/>
> </Element>
> <Element content="five">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix="">http://example.com/foo</Namespace>
> </Element>
> <Element content="six">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> <Namespace prefix="">http://example.com/foo</Namespace>
> </Element>
> <Element content="seven">
> <Namespace prefix="xml">http://www.w3.org/XML/1998/namespace</Namespace>
> </Element>
> I have a real-world stylesheet that serializes elements as character data, in XML syntax, in an HTML textarea. I rely on the namespace axis to faithfully report what namespaces are in scope. I'd like to not have to go out of my way to ignore extra namespace nodes in this one XSLT processor.
> Thanks for considering this issue.

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