1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 20:25:14 +03:00
Commit Graph

415 Commits

Author SHA1 Message Date
Denis Pauk
a0cd075d94 HTML parser error with <noscript> in the <head>
For https://bugzilla.gnome.org/show_bug.cgi?id=615785
When the <noscript> is found, <head> is closed and a <body> element is created.
The real <body id="xxx"> gets skipped over, so I can't see any of the
body's attributes.
Just don't close <head> when encountering a <noscript>
Add a regression test too
2012-05-11 19:31:12 +08:00
Remi Gacogne
4609e6c980 XSD: optional element in complex type extension
For https://bugzilla.gnome.org/show_bug.cgi?id=609796
Libxml2 fails to validate an instance document against a schema if an element
whose type is a complex extension of some base type with an optional child
element and that child element is not specified in the instance document.  For
example, suppose I have some complex type BaseType that is defined to have one
child element in a sequence group that has minOccurs set to 0
2012-05-11 15:31:05 +08:00
Denis Pauk
868d92da89 Add HTML parser support for HTML5 meta charset encoding declaration
For https://bugzilla.gnome.org/show_bug.cgi?id=655218

http://www.w3.org/TR/2011/WD-html5-20110525/semantics.html#the-meta-element

"""
The charset attribute specifies the character encoding used by the document.
This is a character encoding declaration. If the attribute is present in an XML
document, its value must be an ASCII case-insensitive match for the string
"UTF-8" (and the document is therefore forced to use UTF-8 as its
encoding).
"""

However, while <meta http-equiv="Content-Type" content="text/html;
charset=utf8"> works, <meta charset="utf8"> does not.

While libxml2 HTML parser is not tuned for HTML5, this is a simple
addition

Also added a testcase
2012-05-10 15:34:57 +08:00
Daniel Veillard
77b77b1301 Fix SAX2 builder in case of undefined element namespaces
Work as in XML-1.0 before namespaces, and use prefix:localname
as the new element name (and no namespace of course)
Also fix 3 cases in the regression tests where the prefix: was
erroneously dropped in such case
2012-01-26 19:11:02 +08:00
Daniel Veillard
cb3549e30a Improve the error report on undefined REFs
Use the tree node to provide the error context instead
of the parser input which is not relevant anymore,
based on a suggestion by François Delyon <f.delyon@satimage.fr>
2011-11-11 13:43:51 +08:00
Daniel Veillard
3c080d6d72 Don't give default HTML boolean attribute values in parser
* HTMLparser.c: don't default value of HTML boolean attributes in the
  parser
* SAX2.c: move this to SAX2 tree building backend
* result/HTML/doc2.htm.sax result/HTML/doc3.htm.sax
  result/HTML/wired.html.sax: this changes a few HTML SAX regression
  tests
2010-03-15 15:47:50 +01:00
Daniel Veillard
aa422d9254 595792 fixing a RelaxNG bug introduced in 2.7.4
* relaxng.c: refs definitions added from inported schemas should not
  be processed as refs from the main schemas
* test/relaxng/595792* result/relaxng/595792*: add the test to the
  regression suite
2009-09-24 11:31:48 +02:00
Daniel Veillard
9332b48f16 Fix a Relaxng bug raised by libvirt test suite
* xmlregexp.c: other fixes in 2.7.4 raised this internal error
  when comparing ranges, this affects among others detection of
  the determinism
* test/relaxng/libvirt* result/relaxng/libvirt*: add a test case
  based on libvirt schemas and tests
2009-09-23 18:28:43 +02:00
Daniel Veillard
1ba2aca3eb 492317 Fix Relax-NG validation problems
* relaxng.c xmlregexp.c: a subtle problem when checking for compileable
  content model, if using the same elements in cases of choices. Handled
  by adding a special flag to the regexp compilation to detect
  transitions with different atoms using same strings.
* test/relaxng/492317* result/relaxng/492317*: add the test to the
  regression suite
2009-08-31 16:47:39 +02:00
Daniel Veillard
ec18c96008 558452 fight with reg test and error report
* relaxng.c: tiny fix and provide more context on some errors
* result/relaxng/558452_0* test/relaxng/558452*: add some regression
  tests for the bugs
* Makefile.am runtest.c: fight with the fact streaming error messages
  can differ due to missing node context
2009-08-26 18:37:43 +02:00
Daniel Veillard
4013e83e84 579746 XSD validation not correct / nilable groups
* xmlschemas.c: when a particle need to be processed via counted
  transition, if the group is nillable, the counting won't work, so
  keep track of nillable subset as they are built and generate the
  appropriate epsilon transitions as needed
* test/schemas/579746* result/schemas/579746*: add related test cases
  based on the bug report
2009-08-26 17:24:31 +02:00
Daniel Veillard
a6c76a26ca 566012 part 2 fix regresion tests and push mode
* test/utf16bebom.xml: regression test showed that this test case was
  broken but previous behaviour would not detect it !
* parser.c: fix 566012 for the push mode of the parser, tricky !
* test/ebcdic_566012.xml result//ebcdic_566012.xml*: add the test to the
  regression suite
2009-08-26 14:37:00 +02:00
Daniel Veillard
283d50279d 587663 Incorrect Attribute-Value Normalization
* parser.c: when replacing entities and that the entity is CDATA and
  reference entities then white space character in replacement text
  need to be replaced by 0x20
* result/noent/att10: correct the output of the associated regression
  test
2009-08-25 17:18:39 +02:00
Daniel Veillard
d80d0728bf 559410 - Regexp bug on (...)? constructs
* xmlregexp.c: fix a regexp bug on some (...)? constructs
* test/schemas/nvdcve* result/schemas/nvdcve*: add the tests to the
  regression suite
2009-08-22 18:56:01 +02:00
Daniel Veillard
a721612e54 446613 small validation bug mixed content with NS
* valid.c: fix a bug when valdating mixed content lists and some
  name use namespaces prefixes.
* result/valid/notes.xml* test/valid/dtds/notes.dtd * test/valid/notes.xml:
  add the test case to the regression suite
2009-08-21 18:22:58 +02:00
Daniel Veillard
bd56c44349 571271 fix semantic of xsd:all with minOccurs=0
* xmlschemas.c: apparently we though it allowed any of the sub elements
  to be missing, and probably not what's expected from the spec, though
  it used to forbid it c.f.:
  http://lists.xml.org/archives/xml-dev/200109/msg00512.html
  asking HT for confirmation but it's likely that we were wrong on the
  semantic
* result/schemas/all_1_[367]*: this changes the output of soem of our
  internal regression tests
2009-08-12 15:39:23 +02:00
Daniel Veillard
be390ed0a1 Test case for 570702 2009-08-12 12:40:39 +02:00
Jason Childs
edc68aadf8 582906 XSD validating multiple imports of the same schema
* xmlschemas.c: When validating a schema that includes the same file
  that has no targetNamespace defined an internal erro was thrown,
  depending on the orig namespace that should be allowed though
* test/schemas/582906-* result/schemas/582906-*: 2 tests case, one
  where this is allowed, and one where this is forbidden
2009-08-07 20:29:33 +02:00
Jason Childs
d996072077 Bug 582887 – problems validating complex schemas
* xmlschemas.c: fixes the problem faced when importing the same schemas
  multiple times but from different places which is allowed
* test/schemas/582887* result/schemas/582887*: adding the specific test
  to the regressions
2009-08-07 19:01:32 +02:00
Aleksey Sanin
838682478c Aleksey Sanin support for c14n 1.1
* c14n.c include/libxml/c14n.h: adds support for C14N 1.1,
  new flags at the API level
* runtest.c Makefile.am testC14N.c xmllint.c: add support in CLI
  tools and test binaries
* result/c14n/1-1-without-comments/* test/c14n/1-1-without-comments/*:
  add a new batch of tests
2009-07-09 10:26:22 +02:00
Daniel Veillard
7f4547cdbd preparing the release of 2.7.2 fix the Solaris portability issue
* configure.in doc/* NEWS: preparing the release of 2.7.2
* dict.c: fix the Solaris portability issue
* parser.c: additional cleanup on #554660 fix
* test/ent13 result/ent13* result/noent/ent13*: added the
  example in the regression test suite.
* HTMLparser.c: handle leading BOM in htmlParseElement()
Daniel

svn path=/trunk/; revision=3799
2008-10-03 07:58:23 +00:00
Daniel Veillard
a57ba4ce96 fix an HTML parsing error on large data sections reported by Mike Day add
* HTMLparser.c: fix an HTML parsing error on large data sections
  reported by Mike Day
* test/HTML/utf8bug.html result/HTML/utf8bug.html.err
  result/HTML/utf8bug.html.sax result/HTML/utf8bug.html: add the
  reproducer to the test suite
daniel

svn path=/trunk/; revision=3797
2008-09-25 16:06:18 +00:00
Daniel Veillard
0161e638c6 completely different fix for the recursion detection based on entity
* parser.c include/libxml/parser.h: completely different fix for
  the recursion detection based on entity density, big cleanups
  in the entity parsing code too
* result/*.sax*: the parser should not ask for used defined versions
  of the predefined entities
* testrecurse.c: automatic test for entity recursion checks
* Makefile.am: added testrecurse
* test/recurse/lol* test/recurse/good*: a first set of tests for
  the recursion
Daniel

svn path=/trunk/; revision=3783
2008-08-28 15:36:32 +00:00
Daniel Veillard
bf9c1dad3a add the testchar to 'make check' Volker Grabsch pointed out a typo
* Makefile.am: add the testchar to 'make check'
* xmlschemas.c: Volker Grabsch pointed out a typo
* xmlregexp.c: production [19] from XML Schemas regexps were a
  mistake removed in version REC-xmlschema-2-20041028, Volker Grabsch
  provided a patch to remove it
* test/schemas/regexp-char-ref_0.xml test/schemas/regexp-char-ref_0.xsd
  test/schemas/regexp-char-ref_1.xsd result/schemas/regexp-char-ref_0_0
  result/schemas/regexp-char-ref_1_0: Volker Grabsch also provided
  regession tests for this
Daniel

svn path=/trunk/; revision=3776
2008-08-26 07:46:42 +00:00
Daniel Veillard
d7af555327 rewrite the URI parser to update to rfc3986 (from 2396) removed the error
* uri.c include/libxml/uri.h: rewrite the URI parser to update to
  rfc3986 (from 2396)
* test/errors/webdav.xml result/errors/webdav.xml*: removed the
  error test, 'DAV:' is a correct URI under 3986
* Makefile.am: small cleanup in make check
Daniel

svn path=/trunk/; revision=3763
2008-08-04 15:29:44 +00:00
Daniel Veillard
373345764b added a skipped list, insert rmt-ns10-035 improve 'make check' clean up
* runxmlconf.c: added a skipped list, insert rmt-ns10-035
* Makefile.am: improve 'make check'
* include/libxml/xmlerror.h parser.c: clean up namespace errors
  checking and reporting, errors when a document is labelled
  as UTF-16 while it is parsed as UTF-8 and no encoding was given
  explicitely.
* result/errors/webdav.xml.*: some warnings are no recategorized
  as Namespace errors
Daniel

svn path=/trunk/; revision=3761
2008-07-31 08:20:02 +00:00
Daniel Veillard
97c9ce2e99 fix various attribute normalisation problems reported by Ashwin this
* parser.c: fix various attribute normalisation problems reported
  by Ashwin
* result/c14n/without-comments/example-4
  result/c14n/with-comments/example-4: this impacted the result of
  two c14n tests :-\
* test/att9 test/att10 test/att11 result//att9* result//att10*
  result//att11*: added 3 specific regression tests coming from the
  XML spec revision and from Ashwin
Daniel

svn path=/trunk/; revision=3715
2008-03-25 16:52:41 +00:00
Daniel Veillard
8bf64aef50 fix a problem reported by Ashwin for system parameter entities referenced
* parser.c: fix a problem reported by Ashwin for system parameter
  entities referenced from entities in external subset, add a
  specific loading routine.
* test/valid/dtds/external.ent test/valid/dtds/external2.ent
  test/valid/t11.xml result/valid/t11.xml*: added the test to
  the regression suite
Daniel

svn path=/trunk/; revision=3713
2008-03-24 20:45:21 +00:00
Daniel Veillard
d0d2f090dc fix handling of empty CDATA nodes as reported and discussed around #514181
* xmlsave.c parser.c: fix handling of empty CDATA nodes as 
  reported and discussed around #514181 and associated patches
* test/emptycdata.xml result/emptycdata.xml* 
  result/noent/emptycdata.xml: added a specific test in the
  regression suite.
Daniel

svn path=/trunk/; revision=3701
2008-03-07 16:50:21 +00:00
Daniel Veillard
57c9db0725 poblem with encoding detection for UTF-16 reported by Ashwin and found by
* encoding.c: poblem with encoding detection for UTF-16 reported by
  Ashwin and found by Bill
* test/valid/dtds/utf16b.ent test/valid/dtds/utf16l.ent
  test/valid/UTF16Entity.xml result/valid/UTF16Entity.xml*: added
  the example to the regression tests
Daniel

svn path=/trunk/; revision=3700
2008-03-06 14:37:10 +00:00
Daniel Veillard
041b687e93 apply patch from Andrew Tosh to fix behaviour when '.' is used in a
* xmlregexp.c: apply patch from Andrew Tosh to fix behaviour
  when '.' is used in a posCharGroup
* test/schemas/poschargrp0_0.* result/schemas/poschargrp0_0_0*:
  added the test to the regression suite
Daniel

svn path=/trunk/; revision=3687
2008-02-08 10:37:18 +00:00
Daniel Veillard
c707d0b765 fix a memeory leak in internal subset parsing with a fix from Ashwin add
* parser.c: fix a memeory leak in internal subset parsing with
  a fix from Ashwin
* test/errors/content1.xml result/errors/content1.xml*:
  add test to regressions
Daniel

svn path=/trunk/; revision=3680
2008-01-24 14:48:54 +00:00
Daniel Veillard
c821e03c66 another nasty regexp case fixed. added to regression suite Daniel
* xmlregexp.c: another nasty regexp case fixed.
* test/regexp/ranges2 result/regexp/ranges2: added to regression
  suite
Daniel

svn path=/trunk/; revision=3658
2007-08-28 17:33:45 +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
da62934715 fixed a parser bug where invalid char in comment may not be detected,
* parser.c: fixed a parser bug where invalid char in comment may
  not be detected, reported by Ashwin Sinha
* test/errors/comment1.xml result/errors/comment1.xml*: added
  the example to the regression suite
Daniel

svn path=/trunk/; revision=3647
2007-08-01 07:49:06 +00:00
Daniel Veillard
dfac946c3d fixed the push mode when a big comment occurs before an internal subset,
* parser.c: fixed the push mode when a big comment occurs before
  an internal subset, should close bug #438835
* test/comment6.xml result//comment6.xml*: added a special
  test in the regression suite
Daniel

svn path=/trunk/; revision=3635
2007-06-12 14:44:32 +00:00
Daniel Veillard
b9e5acc490 fix bug #414846 where invalid characters in attributes would sometimes not
* parser.c: fix bug #414846 where invalid characters in attributes
  would sometimes not be detected.
* test/errors/attr4.xml result/errors/attr4.xml*: added a specific
  test case to the regression tests
Daniel

svn path=/trunk/; revision=3634
2007-06-12 13:43:00 +00:00
Daniel Veillard
42720248e6 change the way script/style are parsed to not try to detect comments,
* HTMLparser.c: change the way script/style are parsed to
  not try to detect comments, reported by Mike Day
* result/HTML/doc3.*: affects the result of that test
Daniel

svn path=/trunk/; revision=3598
2007-04-16 07:02:31 +00:00
William M. Brack
a9cbf28361 fixed problem with 0x2d in Char Range (bug #420596) added regression test
* xmlregexp.c: fixed problem with 0x2d in Char Range (bug #420596)
* test/regexp/bug420596, result/regexp/bug420596: added regression
  test for this

svn path=/trunk/; revision=3594
2007-03-21 13:16:33 +00:00
Daniel Veillard
c47d263049 fixing HTML minimized attribute values to be generated internally if not
* HTMLparser.c: fixing HTML minimized attribute values to be generated
  internally if not present, fixes bug #332124
* result/HTML/doc2.htm.sax result/HTML/doc3.htm.sax
  result/HTML/wired.html.sax: this affects the SAX event strem for
  a few test cases
Daniel
2006-10-17 16:13:27 +00:00
Daniel Veillard
48519092e5 fixing HTML entities in attributes parsing bug #362552 added to the
* HTMLparser.c: fixing HTML entities in attributes parsing bug #362552
* result/HTML/entities2.html* test/HTML/entities2.html: added to
  the regression suite
Daniel
2006-10-17 15:56:35 +00:00
Daniel Veillard
dcec672439 fix the patch for unreproductable #343000 but also fix a line/column
* parser.c: fix the patch for unreproductable #343000 but
  also fix a line/column keeping error
* result/errors/attr1.xml.err result/errors/attr2.xml.err
  result/errors/name.xml.err result/errors/name2.xml.err
  result/schemas/anyAttr-processContents-err1_0_0.err
  result/schemas/bug312957_1_0.err: affected lines in error output
  of the regression tests
Daniel
2006-10-15 20:32:53 +00:00
Daniel Veillard
be58a0a319 Adding test file, Daniel 2006-10-13 16:39:14 +00:00
Daniel Veillard
166e1a9b59 Adding extra test files, just in case ... Daniel 2006-10-10 20:12:24 +00:00
Kasimier T. Buchcik
7b4e2e20fd Removed the automatic generation of CDATA sections for the content of the
* xmlsave.c: Removed the automatic generation of CDATA sections
  for the content of the "script" and "style" elements when
  serializing XHTML. The issue was reported by Vincent Lefevre,
  bug #345147.
* result/xhtml1 result/noent/xhtml1: Adjusted regression test
  results due to the serialization change described above.
2006-07-13 13:07:11 +00:00
Kasimier T. Buchcik
1d0f7ad610 Adjusted the result of a regression test, since the fix of
* result/pattern/namespaces: Adjusted the result of a
  regression test, since the fix of xmlGetNodePath() revealed a
  bug in this test result.
2006-06-12 11:25:50 +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
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
54eb0243c4 applied patch from Youri Golovanov fixing bug #316338 and adding a couple
* xmlregexp.c: applied patch from Youri Golovanov fixing bug
  #316338 and adding a couple of optimizations in the regexp
  compilation engine.
* test/regexp/bug316338 result/regexp/bug316338: added regression
  tests based on the examples provided in the bug report.
Daniel
2006-03-21 23:17:57 +00:00
Daniel Veillard
7933800926 Added new regression tests for #331062, daniel 2006-02-19 15:32:29 +00:00