You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by "Ian Young (JIRA)" <ji...@apache.org> on 2013/03/06 22:34:14 UTC

[jira] [Created] (SANTUARIO-353) ReferenceSubTreeData.iterator() does not return nodes in document order

Ian Young created SANTUARIO-353:
-----------------------------------

             Summary: ReferenceSubTreeData.iterator() does not return nodes in document order
                 Key: SANTUARIO-353
                 URL: https://issues.apache.org/jira/browse/SANTUARIO-353
             Project: Santuario
          Issue Type: Bug
          Components: Java
    Affects Versions: Java 1.5.3
            Reporter: Ian Young
            Assignee: Colm O hEigeartaigh


I've been working on some signature validation code, and one approach I took led me to look at Reference.getReferenceData().  This is with 1.5.3 of the Java library.

In my case, the reference URI is always a document-local reference, i.e., either "" or "#foo", and I look at getReferenceData() after calling Signature.checkSignatureValue.  The result of this is both a ReferenceNodeSetData and a ReferenceSubTreeData.

My current approach involves looking at the ReferenceSubTreeData, but I also looked at the node set returned from ReferenceNodeSetData.iterator() in this case.  In the Javadoc, it specifies that the nodes are returned in document order, which I understand to mean that Element nodes appear before the Attribute nodes associated with them.

What I actually found was that the Attribute nodes for an elemeent appeared in the iterator() sequence *before* the Element node itself.

Comment on the list from Marc Giger:

Yes it seems there is a discrepancy between the Javadoc and the actual
implementation. Additionally the Javadoc states that an
UnsupportetOperationException will be thrown when an element is removed
via iterator which actually doesnt happen.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira