[ 
https://issues.apache.org/jira/browse/XERCESJ-832?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

George Bina updated XERCESJ-832:
--------------------------------

    Attachment: XPathMatcher.java

I attached the new XPathMatcher class.
This solves all the 4 open issues related with identity constraints: 
XERCESJ-832, XERCESJ-846, XERCESJ-1138 and XERCESJ-1396.

The implementation creates a matcher for each location path and then it just 
delegates to these matchers. Each matcher stores a set of indices pointing to 
the steps to be matched as the current state. It uses a stack to save these 
indices when moving to a child and to restore them when returning from a child 
element. We need a set of indices because the descendant step can generate more 
steps as current, for example, imagine an XPath like

.//a/a/a/a

When we have a document fragment like

<a>
  <a>
    <a>
....

after this 3rd a we can expect the next element at all locations marked with ^ 
below

.//^a/^a/^a/^a

So, in this case we will have 4 indices representing the match state of this 
location path.
I reused the IntStack to store these sets, putting the values first, followed 
by the length of the set.

If you have any questions just let me know.


> element order matters on keyref checking?
> -----------------------------------------
>
>                 Key: XERCESJ-832
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-832
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.0 Structures
>    Affects Versions: 2.5.0
>         Environment: Operating System: Other
> Platform: Other
>            Reporter: Jon Schewe
>         Attachments: 24724.patch, dome.xsd, test.xml, test.xml, 
> XPathMatcher.java
>
>
> By reversing the order of the Entity tags RoleKeyRef will fail.  However to 
> get
> to this point in the validation the patch for bug 24692 needs to be applied
> first, otherwise the keys won't propertly be recognized.

-- 
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to