diff options
author | Kasimier T. Buchcik <kbuchcik@src.gnome.org> | 2005-10-14 14:33:48 +0000 |
---|---|---|
committer | Kasimier T. Buchcik <kbuchcik@src.gnome.org> | 2005-10-14 14:33:48 +0000 |
commit | 27820270838916fb8ee9192fb80af3adb9ca120b (patch) | |
tree | bbc6ff7c874d0c478ad6514cfe9e821f9a0f5176 /pattern.c | |
parent | cb418de04da834d6ba23a715d3eaf8c9297e9029 (diff) | |
download | libxml2-27820270838916fb8ee9192fb80af3adb9ca120b.tar.gz |
Fixed some identity-constraint issues: Restructured IDC node-tables
* xmlschemas.c: Fixed some identity-constraint issues:
Restructured IDC node-tables
Allowed IDCs to resolve also to nodes of complex type with
simple content.
Added check for keyrefs with references to keyrefs.
IDC target-nodes were interferring with IDC node-tables,
since they used one list of entries only. I separated this
one big list into 3 lists: 1 for IDC node-table entries,
1 for _duplicates_ of IDC node-table entries and 1 for
IDC target-nodes. More code, but cleaner and it works at last.
Keyrefs will fail to resolve to duplicate key/unique entries.
I thought this was already working this way, but it didn't.
The wording of the definition for [node table] in the spec
can lead to a scenario, where keyrefs resolve perfectly, even
if the relevant key-sequences of the referenced key/unique have
duplicates in the subtree. Currently only Saxon 8.5.1 is
dissallowing resolution to duplicate entries correctly - we
will follow Saxon here.
Removed some intel compiler warnings (reported by
Kjartan Maraas, bug #318517).
* pattern.c: Fixed an IDC-XPath problem when resolving to
attributes.
Diffstat (limited to 'pattern.c')
-rw-r--r-- | pattern.c | 22 |
1 files changed, 16 insertions, 6 deletions
@@ -1710,9 +1710,14 @@ xmlStreamPushInternal(xmlStreamCtxtPtr stream, /* * Check for correct node-type. */ - if ((nodeType == XML_ATTRIBUTE_NODE) && - ((comp->steps[step].flags & XML_STREAM_STEP_ATTR) == 0)) - goto next_state; + if (nodeType == XML_ELEMENT_NODE) { + if (comp->steps[step].flags & XML_STREAM_STEP_ATTR) + goto next_state; + + } else if (nodeType == XML_ATTRIBUTE_NODE) { + if ((comp->steps[step].flags & XML_STREAM_STEP_ATTR) == 0) + goto next_state; + } /* * Compare local/namespace-name. */ @@ -1816,9 +1821,14 @@ compare: /* * Check expected node-type. */ - if ((nodeType == XML_ATTRIBUTE_NODE) && - ((comp->steps[0].flags & XML_STREAM_STEP_ATTR) == 0)) - goto stream_next; + if (nodeType == XML_ELEMENT_NODE) { + if (comp->steps[0].flags & XML_STREAM_STEP_ATTR) + goto stream_next; + + } else if (nodeType == XML_ATTRIBUTE_NODE) { + if ((comp->steps[0].flags & XML_STREAM_STEP_ATTR) == 0) + goto stream_next; + } /* * Compare local/namespace-name. */ |