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 20:30:51 UTC

[jira] Created: (XALANJ-2335) Xalan-J incorrectly identifies the parents of namespace nodes

Xalan-J incorrectly identifies the parents of namespace nodes
-------------------------------------------------------------

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


Xalan-J 2.7.0 incorrectly identifies the parents of namespace nodes.

A namespace node's parent is supposed to be the element the namespace node is associated with.

In Xalan, for a namespace node with an empty local-name, parent::* incorrectly identifies the grandparent element. And for a namespace node with local-name 'xml', parent::* incorrectly identifies the document element in every case.


-- 
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-2335) Xalan-J incorrectly identifies the parents of namespace nodes

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

Henry Zongaro resolved XALANJ-2335.
-----------------------------------

    Resolution: Duplicate

> Xalan-J incorrectly identifies the parents of namespace nodes
> -------------------------------------------------------------
>
>                 Key: XALANJ-2335
>                 URL: http://issues.apache.org/jira/browse/XALANJ-2335
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XPath
>    Affects Versions: 2.7
>            Reporter: Mike Brown
>            Priority: Minor
>
> Xalan-J 2.7.0 incorrectly identifies the parents of namespace nodes.
> A namespace node's parent is supposed to be the element the namespace node is associated with.
> In Xalan, for a namespace node with an empty local-name, parent::* incorrectly identifies the grandparent element. And for a namespace node with local-name 'xml', parent::* incorrectly identifies the document element in every case.

-- 
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-2335) Xalan-J incorrectly identifies the parents of namespace nodes

Posted by "Mike Brown (JIRA)" <xa...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XALANJ-2335?page=comments#action_12448337 ] 
            
Mike Brown commented on XALANJ-2335:
------------------------------------

It depends on how you define "really important". I can work around it, but I don't see why I shouldn't expect Xalan to follow the XPath 1.0 data model when processing an XSLT 1.0 stylesheet.

In a real-world web application, I am using XSLT to produce a manual serialization of an XML fragment. I generate a text node representing the fragment in XML syntax, and this gets put into a textarea in my stylesheet's HTML output.

When I process an element node to generate its start-tag, I first generate a namespace declaration for the default namespace, if necessary. Then I set out to generate namespace declarations for any prefixes that are in scope.

To this end, I process the element's namespace nodes that bind non-empty prefixes.  For each of these namespace nodes, I decide whether to emit a namespace declaration depending on whether the same binding is in effect on the element's parent. So, when processing the namespace nodes, I need to access their parents and grandparents.

My first inclinaton was to use the parent axis to get to those nodes, but I found that Xalan gives me the wrong ones.  I can work around it by binding the parent element to a variable that I reference when processing the namespace nodes, but I shouldn't have to do that.



IMHO this isn't really a duplicate of the other issues you mention. Yes, they have the same root cause -- a decision to ignore the requirement that each element has a unique set of namespace nodes -- but the symptom of the parent/ancestor axes being unreliable relative to a namespace node is distinct from the symptom of the namespace node ID not being unique (issues 1325/1962/2080) and the symptom of namespace nodes not existing along the namespace axis at all (issue 334, which has actually been fixed). I'd expect addressing these different symptoms to have different priorities, even if they'd ideally be resolved in one fell swoop.

When those issues were ignored or declared "wont fix" as far back as 2001, it was in anticipation of XSLT 2.0 legitimizing Xalan's practice of not defining as many namespace nodes as required ...and apparently in anticipation of XPath/XSLT 2.0 rendering 1.0 a historical curiosity overnight. But this "why bother since XSLT2 is coming" reasoning has proven to be unsound.

First, this is an XPath/XSLT 1.0 processor (thank goodness). As long as it processes stylesheets that declare their version to be 1.0, I expect it to behave like a 1.0 processor is supposed to behave. The features planned for XPath/XSLT 2.0 do not change what is required of an XPath/XSLT 1.0 processor. The 1.0 data model is still in effect.

Second, here we are 5 years later, and not only is XPath/XSLT 2.0 still unfinished and considered by many to be overkill, but it's pretty clear that even if you were going to support the 2.0 data model, you'd still have to fix the bugs because XPath 2.0 actually won't change the behavior of the namespace axis at all; it'll just make supporting it optional, since it'll provide an alternative method of accessing namespace bindings. Namespace nodes, if supported, will still have to have unique IDs and will have to have the correct parents (this is explicit in XPath 2.0 sec. 6.4.1).

Mike

> Xalan-J incorrectly identifies the parents of namespace nodes
> -------------------------------------------------------------
>
>                 Key: XALANJ-2335
>                 URL: http://issues.apache.org/jira/browse/XALANJ-2335
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XPath
>    Affects Versions: 2.7
>            Reporter: Mike Brown
>            Priority: Minor
>
> Xalan-J 2.7.0 incorrectly identifies the parents of namespace nodes.
> A namespace node's parent is supposed to be the element the namespace node is associated with.
> In Xalan, for a namespace node with an empty local-name, parent::* incorrectly identifies the grandparent element. And for a namespace node with local-name 'xml', parent::* incorrectly identifies the document element in every case.

-- 
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-2335) Xalan-J incorrectly identifies the parents of namespace nodes

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

The phrase "really important" was a poor choice on my part.  What I ought to have said is that nobody has been able to describe a realistic scenario in which each element has to have its own unique set of namespace nodes for its in-scope namespaces.  All the examples I've seen in the past involved stylesheets created specifically to test that aspect of the XPath Recommendation; they were not examples drawn from real-world stylesheets that were being used put to some useful purpose.  Almost anything that falls outside of the former category would have satisfied my criteria for what constitutes really important.  So, my thanks to you for providing such an example.

You make an interesting point when you question whether this issue ought to have been closed as a duplicate of an earlier issue.  I closed this as a duplicate of previous issues because they all represent one and the same bug, regardless of the distinct manifestations of the problem.  By closing it as a duplicate, I don't intend to make it seem less important.  In fact, I think that from the point of view of users, its advantageous to have multiple distinct issues closed as duplicates of one bug, despite the fact that they all describe distinct symptoms.  That's because users can do things like all vote for the one bug that remains open, rather than having their votes diluted amongst four distinct bug reports.

Regarding whether those older bugs should have been marked as "wontfix," I don't think they should have.  That's why I've not moved to close XALANJ-1962, and if anybody else does close it as "wontfix," I will reopen it; it represents a valid bug, regardless of whether the namespace axis might have been poorly designed.

> Xalan-J incorrectly identifies the parents of namespace nodes
> -------------------------------------------------------------
>
>                 Key: XALANJ-2335
>                 URL: http://issues.apache.org/jira/browse/XALANJ-2335
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XPath
>    Affects Versions: 2.7
>            Reporter: Mike Brown
>            Priority: Minor
>
> Xalan-J 2.7.0 incorrectly identifies the parents of namespace nodes.
> A namespace node's parent is supposed to be the element the namespace node is associated with.
> In Xalan, for a namespace node with an empty local-name, parent::* incorrectly identifies the grandparent element. And for a namespace node with local-name 'xml', parent::* incorrectly identifies the document element in every case.

-- 
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-2335) Xalan-J incorrectly identifies the parents of namespace nodes

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

This is a known problem with Xalan-J's representation of namespace nodes.  It's previously been reported in issues XALANJ-334 and XALANJ-1325. XALANJ-2080 and XALANJ-1962.  This has never been given a high priority, because nobody's been able to describe a scenario in which it's really important for each element to have its own unique set of namespace nodes for its in-scope namespaces.  I'd be interested in hearing whether you have identified such a scenario?

> Xalan-J incorrectly identifies the parents of namespace nodes
> -------------------------------------------------------------
>
>                 Key: XALANJ-2335
>                 URL: http://issues.apache.org/jira/browse/XALANJ-2335
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XPath
>    Affects Versions: 2.7
>            Reporter: Mike Brown
>            Priority: Minor
>
> Xalan-J 2.7.0 incorrectly identifies the parents of namespace nodes.
> A namespace node's parent is supposed to be the element the namespace node is associated with.
> In Xalan, for a namespace node with an empty local-name, parent::* incorrectly identifies the grandparent element. And for a namespace node with local-name 'xml', parent::* incorrectly identifies the document element in every case.

-- 
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-2335) Xalan-J incorrectly identifies the parents of namespace nodes

Posted by "Mike Brown (JIRA)" <xa...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XALANJ-2335?page=comments#action_12448504 ] 
            
Mike Brown commented on XALANJ-2335:
------------------------------------

Thanks for the explanation. I disagree somewhat on the advantage of having distinct symptoms marked as duplicate issues. From the point of view of users, it's unlikely to be immediately evident how the symptom described in one issue is a manifestation of the same root cause of the symptom they're seeing and considering reporting / checking the status of. I think my perception here is borne out by the fact that people keep submitting issues that get closed as duplicates right away.

If you're going to just keep one issue open, I think it would help if it were given a new title that indicates the root cause and a description that describes key symptoms, rather than just one symptom.

> Xalan-J incorrectly identifies the parents of namespace nodes
> -------------------------------------------------------------
>
>                 Key: XALANJ-2335
>                 URL: http://issues.apache.org/jira/browse/XALANJ-2335
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: XPath
>    Affects Versions: 2.7
>            Reporter: Mike Brown
>            Priority: Minor
>
> Xalan-J 2.7.0 incorrectly identifies the parents of namespace nodes.
> A namespace node's parent is supposed to be the element the namespace node is associated with.
> In Xalan, for a namespace node with an empty local-name, parent::* incorrectly identifies the grandparent element. And for a namespace node with local-name 'xml', parent::* incorrectly identifies the document element in every case.

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