1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-01-27 14:03:36 +03:00

314 Commits

Author SHA1 Message Date
Daniel Veillard
b3e453675a fix a problem in externalSubsetSplit with a patch from Ashwin Daniel
* xmlschemas.c: fix a problem in externalSubsetSplit with a patch
  from Ashwin
Daniel

svn path=/trunk/; revision=3716
2008-03-26 13:39:31 +00:00
Daniel Veillard
77fbc3ea90 fix an XML Schemas crash raised by Stefan Behnel when testing with W3C
* xmlschemas.c: fix an XML Schemas crash raised by Stefan Behnel
  when testing with W3C test suite
Daniel

svn path=/trunk/; revision=3712
2008-03-24 14:06:19 +00:00
Daniel Veillard
7d0ca5e88c apply fix suggested by Ashwin correcting a cut-n-paste error about the SAX
* schemas.c: apply fix suggested by Ashwin correcting a cut-n-paste
  error about the SAX callback in cdataBlockSplit when streaming
  XSD validation 
Daniel

svn path=/trunk/; revision=3684
2008-02-05 08:43:52 +00:00
Daniel Veillard
3888f47263 applied patch from Frank Gross fixing Schemas IDC import bug #455953 and
* xmlschemas.c test/schemas/*455953* result/schemas/bug455953*:
  applied patch from Frank Gross fixing Schemas IDC import bug
  #455953 and also add the test to the regression suite
Daniel

svn path=/trunk/; revision=3652
2007-08-23 09:29:03 +00:00
Daniel Veillard
65fcf27ab8 applied patch for xsi:nil from Frank Gross, this should fix bug #358125
* xmlschemas.c: applied patch for xsi:nil from Frank Gross, this
  should fix bug #358125
Daniel

svn path=/trunk/; revision=3643
2007-07-11 17:55:30 +00:00
Daniel Veillard
734e76675f fix a crash on solaris when a printf %s with a NULL argument occurs,
* xmlschemas.c: fix a crash on solaris when a printf %s with a NULL
  argument occurs, should fix #450936
Daniel

svn path=/trunk/; revision=3641
2007-06-26 11:30:31 +00:00
William M. Brack
06559b3add fixed problem with referenced attribute groups (bug #417621) re-ordered
* xmlschemas.c: fixed problem with referenced attribute groups
  (bug #417621)
* configure.in: re-ordered some includes for types.h / socket.h
  (bug 416001)

svn path=/trunk/; revision=3590
2007-03-14 09:34:15 +00:00
Kasimier T. Buchcik
deb58713d7 While investigating bug #350247, I noticed that xmlSchemaIDCMatcher
* xmlschemas.c: While investigating bug #350247, I noticed
  that xmlSchemaIDCMatcher structs are massively recreated
  although only a maximum of 3 structs is used at the same
  time; added a cache for those structures to the
  validation context.
2006-08-15 12:52:30 +00:00
Daniel Veillard
6f9b0878c0 applied patch from Marton Illes to fix an allocation bug in
* xmlschemas.c: applied patch from Marton Illes to fix an allocation
  bug in xmlSchemaXPathEvaluate should close #351032
Daniel
2006-08-12 14:09:01 +00:00
Daniel Veillard
1131e116a0 applied patch from Bertrand Fritsch to fix a bug in
* xmlschemas.c: applied patch from Bertrand Fritsch to fix a bug in
  xmlSchemaClearValidCtxt
Daniel
2006-08-07 11:02:54 +00:00
Kasimier T. Buchcik
f896d44aac Fixed bug #347316, reported by David Belius: The simple type, which was
* xmlschemas.c: Fixed bug #347316, reported by David Belius:
  The simple type, which was the content type definition
  of a complex type, which in turn was the base type of a
  extending complex type, was missed to be set on this
  extending complex type in the derivation machinery.
2006-07-12 15:18:08 +00:00
Kasimier T. Buchcik
e5f810f69b A warning will now be reported in the value of the XSD attribute
* xmlschemas.c: A warning will now be reported in the value of
  the XSD attribute 'schemaLocation' does not consist of tuples
  (namespace-name, document-URI). A warning will be reported
  if a schema document could not be found at the specified
  location (via 'schemaLocation' or
  'noNamespaceSchemaLocation').
* include/libxml/xmlerror.h: Added XML_SCHEMAV_MISC to
  xmlParserErrors.
2006-05-30 09:41:25 +00:00
Kasimier T. Buchcik
9b02e295c1 Fixed bug #341337, reported by David Grohmann. The code expected a node
* xmlschemas.c: Fixed bug #341337, reported by David Grohmann.
  The code expected a node (xmlNodePtr) on the info for a
  non-existent default attribute, which clearly cannot be
  expected, since the attribute does not exist. I can only
  guess that this sneaked trying to eliminate the query
  for the owner-element, which is unavoidable actually.
  Note that creation of default attributes won't have an
  effect if validating via SAX/XMLReader; i.e., the processor
  won't fire additional start-attribute events (I'm not even
  sure if Libxml2 has such a SAX-event; I think it hands them
  all over in the start-element event).
2006-05-11 16:25:44 +00:00
Kasimier T. Buchcik
92b394fcf3 Fixed bug #341150, reported by Michael Romer. In
* xmlschemas.c: Fixed bug #341150, reported by Michael Romer.
  In xmlSchemaBuildContentModelForSubstGroup(),
  xmlAutomataNewOnceTrans2() was incorrectly used instead of
  xmlAutomataNewTransition2() to mimic a xs:choice for
  substitution-groups.
* test/schemas/subst-group-1_1.xsd
  test/schemas/subst-group-1_0.xml
  result/schemas/subst-group-1_0_1
  result/schemas/subst-group-1_0_1.err: Added regression test
  supplied by Michael Romer for bug #341150.
2006-05-09 19:59:54 +00:00
Kasimier T. Buchcik
146a982e73 We'll raise an internal error and stop validation now when an entity is
* xmlschemas.c: We'll raise an internal error and stop
  validation now when an entity is found in the instance
  document, since we don't support automatic entity
  substitution by the schema processor (yet?) -
  see bug #340316, reported by Nick Wellnhofer.
2006-05-04 17:19:07 +00:00
Kasimier T. Buchcik
b63d2fab2d Fixed incorrect validation of restricted enumerations. Added related
* xmlschemas.c test/schemas/restriction-enum-1*
  result/schemas/restriction-enum-1*: Fixed incorrect
  validation of restricted enumerations. Added related
  regression tests.
2006-04-19 11:20:49 +00:00
Daniel Veillard
cdf59aa58f fixing a deallocation problem in xmlSchemaAddSchemaDoc() in case of
* xmlschemas.c: fixing a deallocation problem in xmlSchemaAddSchemaDoc()
  in case of errors, should fix bug #338303
Daniel
2006-04-13 07:50:11 +00:00
Daniel Veillard
b294717b25 removed unused code or variables, from Stefan Kost fixing #336163 and
* xmlschemas.c: removed unused code or variables, from Stefan Kost
  fixing #336163 and #336164
Daniel
2006-03-27 09:45:01 +00:00
Daniel Veillard
fef73a55c2 applied patch from Stefan Kost fixing #336160 Daniel
* xmlschemas.c: applied patch from Stefan Kost fixing #336160
Daniel
2006-03-27 09:38:57 +00:00
Daniel Veillard
aac7c68e87 fix a few warning raised by gcc-4.1 and latests changes Daniel
* c14n.c encoding.c xmlschemas.c xpath.c xpointer.c: fix a few
  warning raised by gcc-4.1 and latests changes
Daniel
2006-03-10 13:40:16 +00:00
Daniel Veillard
14b5643947 more cleanups based on coverity reports. Daniel
* relaxng.c xmlschemas.c xmlschemastypes.c: more cleanups based
  on coverity reports.
Daniel
2006-03-09 18:41:40 +00:00
Kasimier T. Buchcik
4c0aa16e43 Fixed a side-effect of the previous XSI bugfix: The constructor needs a
* xmlschemas.c: Fixed a side-effect of the previous XSI bugfix:
  The constructor needs a bucket to be assigned during component
  fixup.
2006-02-20 14:47:08 +00:00
Kasimier T. Buchcik
1869be5690 Fixed xs:boolean to reject the empty string (reported by Bas Driessen on
* xmlschemas.c xmlschemastypes.c: Fixed xs:boolean to reject
  the empty string (reported by Bas Driessen on the mailing-list).
  Fixed schema XSI-acquisition and construction: the schemata
  (xmlSchema) didn't get the targetNamespace in some cases, thus
  the component resolution mechanism failed to work. The XSI
  stuff needs to be tested more intensively; think about how
  to test this for regression.
2006-02-20 13:37:55 +00:00
Daniel Veillard
6795260135 upated the news regenerated the docs, preparing for release of 2.6.23
* NEWS configure.in libxml.spec.in testapi.c doc/*: upated the news
  regenerated the docs, preparing for release of 2.6.23
* pattern.c xmlschemas.c: fixed some comments
Daniel
2006-01-05 15:29:44 +00:00
Kasimier T. Buchcik
dfbc33a1f0 Removed last dependency on the obsolete enum xmlSchemaValidError.
* xmlschemas.c: Removed last dependency on the obsolete enum
  xmlSchemaValidError.
2006-01-03 10:51:59 +00:00
Daniel Veillard
d0271473ab compilation and doc build fixes from Michael Day Daniel
* xmlreader.c include/libxml/xmlreader.h xmlschemas.c: compilation
  and doc build fixes from Michael Day
Daniel
2006-01-02 10:22:02 +00:00
Kasimier T. Buchcik
5bb0c08d2f Fixed a segfault during text concatenation when validating a node tree:
* xmlschemas.c xmlstring.c: Fixed a segfault during
  text concatenation when validating a node tree:
  xmlStrncat was called with a @len of -1; but unlike
  xmlStrncatNew, it does not calculate the length
  automatically in such a case (reported by Judy Hay
  on the mailing list).
  Updated the descriptions of the involved string
  functions to note this.
2005-12-20 10:48:33 +00:00
Kasimier T. Buchcik
7ca5aedfc3 Workaround for bug #323510: substituted the epsilon transition for a
* xmlschemas.c: Workaround for bug #323510: substituted the
  epsilon transition for a labelled transition, in order to
  avoid a bug in xmlregexp.c which eliminated the epsilon
  transition and marked the initial state as final.
2005-12-12 15:13:40 +00:00
Daniel Veillard
6a0baa0cd8 fixed a number of warnings shown by HP-UX compiler and reported by Rick
* HTMLparser.c configure.in parserInternals.c runsuite.c runtest.c
  testapi.c xmlschemas.c xmlschemastypes.c xmlstring.c: fixed a number
  of warnings shown by HP-UX compiler and reported by Rick Jones
Daniel
2005-12-10 11:11:12 +00:00
Kasimier T. Buchcik
215406f089 Fixed a segfault: the instance document was still tried to be validated,
* xmlschemas.c: Fixed a segfault: the instance document was
  still tried to be validated, if the schema, dynamically
  acquired using XSI was invalid, thus mangled. The
  validation will stop (or rather won't validate) now in
  such a case. The schema parser error code will be set
  on the validion context now; this is somehow not nice,
  but it assures that the validation context indicates an
  error in there was a parser error.
2005-12-07 12:14:09 +00:00
Kasimier T. Buchcik
f39e8d1f05 Fixed bubbling of duplicate IDC nodes: the parent's list of duplicates was
* xmlschemas.c: Fixed bubbling of duplicate IDC nodes: the
  parent's list of duplicates was filled with NULLs instead
  of the nodes under certain conditions. This lead to a
  segfault when the list's entries were accessed.
2005-11-30 11:03:24 +00:00
Kasimier T. Buchcik
132ba5f5da An assignment to a local variable, which was used to access the IDC node
* xmlschemas.c: An assignment to a local variable, which was
  used to access the IDC node list, was missing after the
  reallocation of the list (reported by Fabrice GUY
  bug #322411). Renamed the define ENABLE_IDC_NODE_TABLES
  to ENABLE_IDC_NODE_TABLES_TEST and *disabled* it, since
  it is used to force bubbling of IDC node tables even
  if not necessary; this was intended to be used for test
  purposes, but I obviously missed to disable it (although
  it apparently helped finding the bug).
2005-11-28 12:32:24 +00:00
Kasimier T. Buchcik
81755ea6c4 In xmlSchemaAssembleByXSI() the return value of xmlSchemaGetMetaAttrInfo()
* xmlschemas.c: In xmlSchemaAssembleByXSI() the return value
  of xmlSchemaGetMetaAttrInfo() was not assigned to anything;
  this caused XSI-driven-dynamic schema acquisition to fail
  with @noNamespaceSchemaLocation (reported by Julien Lamy
  on the mailing list).
2005-11-23 16:39:27 +00:00
Kasimier T. Buchcik
5d2998be54 Fixed a bug in xmlSchemaFindRedefCompInGraph() which caused the search for
* xmlschemas.c: Fixed a bug in xmlSchemaFindRedefCompInGraph()
  which caused the search for components to stop at the
  first encountered attribute group component.
  Fixed error report in xmlSchemaCheckSRCRedefineFirst(): the
  designation of a not-found component was not reported.
2005-11-22 17:36:01 +00:00
Kasimier T. Buchcik
90b5ebc0f3 Added xmlSchemaSetParserStructuredErrors() to the API. Fixed channeling of
* xmlschemas.c include/libxml/xmlschemas.h:
  Added xmlSchemaSetParserStructuredErrors() to the API.
  Fixed channeling of error relevant information to
  subsequent parser/validation contexts.
2005-11-18 17:18:27 +00:00
Kasimier T. Buchcik
77e76829b6 Changed xmlSchemaFormatIDCKeySequence() to use
* xmlschemas.c: Changed xmlSchemaFormatIDCKeySequence()
  to use xmlSchemaGetCanonValueWhtspExt() in order to
  correctly report values for xs:anySimpleType.
* test/schemas/idc-keyref-err1*
  result/schemas/idc-keyref-err1*: Added a test for this change.
2005-11-11 12:52:32 +00:00
Kasimier T. Buchcik
69dea3a0c0 Fixed the type of the totalDigits value to be positiveInteger. Fixed crash
* xmlschemas.c xmlschemastypes.c: Fixed the type of the
  totalDigits value to be positiveInteger.
  Fixed crash in an error report function when we gave it
  the document node; only element and attribute nodes are
  processed now (reported by Rob Richards).
2005-11-07 14:02:44 +00:00
Kasimier T. Buchcik
f326e77cb1 Removed creation of a temporary parser context during validation when
* xmlschemas.c: Removed creation of a temporary parser context
  during validation when processing xsi:type; this previously
  added a string to the dict of the schema - to assure thread
  safety, we don't want to modify a given schema during
  validation.
2005-10-20 11:06:00 +00:00
Kasimier T. Buchcik
940ab0c676 Fixed a potential memory leak in xmlSchemaCheckCSelectorXPath() when an
* xmlschemas.c: Fixed a potential memory leak in
  xmlSchemaCheckCSelectorXPath() when an internal error occurs.
  Fixed setting of ctxt->err to the given error code in
  the parsing error functions.
* pattern.c: Added internal xmlCompileIDCXPathPath() as a
  starting point for IDC XPath compilation; this and some other
  tiny changes fixes issues regarding whitespace in the
  expressions and IDC selector/field relevant restrictions of
  the subset of XPath. Fixed a missing blocking of attributes
  in xmlStreamPushInternal().
2005-10-19 17:00:53 +00:00
Daniel Veillard
567a45b5e9 removed the error message removed 2 instability warnings from function
* runtest.c: removed the error message
* relaxng.c xmlschemas.c: removed 2 instability warnings from function
  documentation
* include/libxml/schemasInternals.h: changed warning about API stability
* xmlregexp.c: trying to improve runtime execution of non-deterministic
  regexps and automata. Not fully finished but should be way better.
Daniel
2005-10-18 19:11:55 +00:00
Kasimier T. Buchcik
ee8e8ae963 Fixed a memory leak in xmlSchemaContentModelDump(). Added output of local
* xmlschemas.c: Fixed a memory leak in
  xmlSchemaContentModelDump(). Added output of local types
  in xmlSchemaElementDump(). Tiny cosmetical changes to the
  dump output.
2005-10-17 14:15:37 +00:00
Kasimier T. Buchcik
65c2f1d78a Silenced intel compiler warnings (reported by Kjartan Maraas, bug
* tree.c pattern.c: Silenced intel compiler warnings (reported
  by Kjartan Maraas, bug #318517).
* xmlschemas.c: The above changes in pattern.c revealed an
  inconsistency wrt IDCs: we now _only_ pop XPath states, if
  we really pushed them beforehand; this was previously not
  checked for the case when we discover an element node to be
  invalid wrt the content model.
  Fixed segfault in xmlSchemaGetEffectiveValueConstraint().
2005-10-17 12:39:58 +00:00
Kasimier T. Buchcik
2782027083 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.
2005-10-14 14:33:48 +00:00
Kasimier T. Buchcik
570faa57c4 Initial implementation for redefinitions; this still misses checks for
* xmlschemas.c include/libxml/schemasInternals.h
  include/libxml/xmlerror.h: Initial implementation for
  redefinitions; this still misses checks for restrictions
  of the content model of complex types.
  Fixed default/fixed values for attributes (looks like they
  did not work in the last  releases).
  Completed constraints for attribute uses.
  Seperated attribute derivation from attribute constraints.
  Completed constraints for attribute group definitions.
  Disallowing <import>s of schemas in no target namespace if the
  importing schema is a chameleon schema. This contradicts
  the way Saxon, Xerces-J, XSV and IBM's SQC works, but the
  W3C XML Schema WG, thinks it is correct to dissalow such
  imports.
  Added cos-all-limited constraints.
  Restructured reference resolution to model groups and element
  declarations.
  Misc cleanup.
2005-10-10 13:18:40 +00:00
Daniel Veillard
33b20b70e2 release of 2.6.22 updated doc and rebuild. added XML_SAVE_NO_XHTML
* NEWS configure.in doc//*: release of 2.6.22 updated doc and
  rebuild.
* xmlsave.c include/libxml/xmlsave.h: added XML_SAVE_NO_XHTML
  xmlSaveOption
* xmlschemas.c: minor cleanups
Daniel
2005-09-12 21:43:20 +00:00
Kasimier T. Buchcik
22c0c46515 Completion of the schema graph. Centralisation, more robustness of the
* xmlschemas.c include/libxml/schemasInternals.h
  include/libxml/xmlerror.h: Completion of the schema graph.
  Centralisation, more robustness of the schema document
  aquisition story. Centralised and restructured component fixup.
  Fixed attribute derivation when 'prohibiting' attribute uses.
  Added warnings: when schema documents cannot be localized
  during imports; when we get duplicate and pointless attribute
  prohibitions. Changed error reports for IDCs to report
  the relevant IDC designation as well (requested by GUY Fabrice).
  Misc code-cleanup.
2005-09-12 19:09:46 +00:00
Kasimier T. Buchcik
630215baf8 Some preparation for the creation of a graph of
* xmlschemas.c: Some preparation for the creation of a graph
  of imported/included/redefined schemas; this is needed for
  at least the redefinitions.
  Centralized the creation of the parser context in one function.
2005-08-22 10:15:39 +00:00
Kasimier T. Buchcik
764b3d61c3 Changed output for keyref-match errors; the target-node will be now
* xmlschemas.c include/libxml/xmlerror.h:
  Changed output for keyref-match errors; the target-node will
  be now reported rather than the scope-node of the keyref
  definition - allowing easier chasing of instance errors.
  This was reported by Guy Fabrice to the mailing list.
  Some initial parsing code for schema redefinitions.
* result/schemas/bug303566_1_1.err
  result/schemas/bug312957_1_0.err: Adapted test results due
  to the keyref changes.
2005-08-12 12:25:23 +00:00
Daniel Veillard
210536bd32 fix for bug #312945 as pointed by Dean Hill, the context type was not
* xmlschemas.c: fix for bug #312945 as pointed by Dean Hill, the
  context type was not always properly initialized.
Daniel
2005-08-10 21:40:02 +00:00
Kasimier T. Buchcik
800cbac34e Fixed #312957 reported by Carol Hunter: streaming XPath states were not
* xmlschemas.c: Fixed #312957 reported by Carol Hunter:
  streaming XPath states were not popped in every case,
  thus failed to resolve correctly for subsequent input.
* test/schemas/bug312957* result/schemas/bug312957*:
  Added the test submitted by Carol Hunter.
2005-08-09 12:31:55 +00:00