1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-09 04:58:16 +03:00

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.
This commit is contained in:
Kasimier T. Buchcik 2005-10-14 14:33:48 +00:00
parent cb418de04d
commit 2782027083
3 changed files with 829 additions and 344 deletions

View File

@ -1,3 +1,28 @@
Fri Oct 14 16:21:22 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
* 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.
Mon Oct 14 01:15:14 CEST 2005 Rob Richards <rrichards@ctindustries.net>
* nanohttp.c include/wsockcompat.h: applied patch from Kolja Nowak
to use getaddrinfo() if supported in Windows build (bug# 317431).

View File

@ -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.
*/

File diff suppressed because it is too large Load Diff