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

631 Commits

Author SHA1 Message Date
Jan Pokorný
8074b88179 Fix unability to validate ambiguously constructed interleave for RelaxNG
Previously, test/relaxng/ambig_name-class.xml would fail to validate
for a simple reason -- interleave within "open-name-class" context
is supposed to be fine with whatever else is pending the consumption,
since effectively, it's unrelated from a higher parsing perspective.

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2019-08-25 13:29:04 +02:00
Nick Wellnhofer
f9fce96313 Fix unsigned integer overflow
It's defined behavior but -fsanitize=unsigned-integer-overflow is
useful to discover bugs.
2019-05-20 13:38:22 +02:00
Nick Wellnhofer
c2f4da1a93 Improve XPath predicate and filter evaluation
Consolidate code paths evaluating XPath predicates and filters.

Don't push context node on stack when evaluating predicates. I have no
idea why this was done. It seems completely useless and trying to pop
the context node from a corrupted stack has already caused security
issues.

Filter nodesets in-place and don't create node sets with NULL gaps which
allows to simplify merging a great deal. Simply move matched nodes
backward and create a compact node set.

Merge xmlXPathCompOpEvalPositionalPredicate into
xmlXPathCompOpEvalPredicate.
2019-04-22 14:48:46 +02:00
Nick Wellnhofer
30a6533e01 Fix float casts in xmlXPathSubstringFunction
Rewrite conversion of double to int in xmlXPathSubstringFunction, adding
range checks to avoid undefined behavior. Make sure to add start and
length as floating-point numbers before converting to int. Fix a bug
when rounding negative start indices.

Remove unneeded calls to xmlXPathIs{Inf,NaN} and rely on IEEE math
instead. Avoid computing the string length. xmlUTF8Strsub works as
expected if the length of the requested substring exceeds the input.

Found with libFuzzer and UBSan.
2019-03-08 14:29:59 +01:00
Nikolai Weibull
c64d4efb31 Remove redefined starts and defines inside include elements
When including a grammar from another grammar, we need to make sure that any
redefines of starts and includes that that grammar does inside any of its
include elements are also removed.
2018-11-29 21:06:06 +01:00
Nikolai Weibull
46da8fc529 Allow choice within choice in nameClass in RELAX NG
The pattern nameClass allows for nested choice elements, for example

  <name>
    <choice>
      <choice>
        <name>a</name>
        <name>b</name>
      </choice>
      <name>c</name>
    </choice>
  </name>

which is semantically equivalent to

  <name>
    <choice>
      <name>a</name>
      <name>b</name>
      <name>c</name>
    </choice>
  </name>

The old code didn’t handle this correctly, as it never expected a choice inside
another choice.  This patch fixes this by flattening any nested choices.

This pattern of nested choice elements comes up in RELAX NG simplification,
where all choice elements are rewritten in this nested manner, see section 4.12
of the RELAX NG specification.
2018-11-29 21:03:11 +01:00
Nikolai Weibull
4338c310eb Look inside divs for starts and defines inside include
RELAX NG allows for div elements inside of include elements.  We need to look
inside those div elements for start and define elements that may be redefining
start and define elements in the included grammar.
2018-11-29 21:00:46 +01:00
Nick Wellnhofer
123234f2cf Free input buffer in xmlHaltParser
This avoids miscalculation of available bytes.

Thanks to Yunho Kim for the report.

Closes: #26
2018-09-11 15:06:17 +02:00
Nick Wellnhofer
7218255092 Add test for ICU flush and pivot buffer 2017-11-04 15:38:58 +01:00
Nick Wellnhofer
5af594d8bc Fix comparison of nodesets to strings
Fix two bugs in xmlXPathNodeValHash which could lead to errors when
comparing nodesets to strings:

- Only use contents of text nodes to compute the hash for element nodes.
  Comments, PIs, and other node types don't affect the string-value and
  must be ignored.
- Reset `string` to NULL for node types other than text.

Reported by Aleksei on the mailing list:

    https://mail.gnome.org/archives/xml/2017-September/msg00016.html
2017-10-07 15:22:57 +02:00
Nick Wellnhofer
69936b129f Revert "Print error messages for truncated UTF-8 sequences"
This reverts commit 79c8a6b which caused a serious regression in
streaming mode.

Also reverts part of commit 52ceced "Fix infinite loops with push
parser in recovery mode".

Fixes bug 786554.
2017-08-30 14:19:06 +02:00
Nick Wellnhofer
899a5d9f0e Detect infinite recursion in parameter entities
When expanding a parameter entity in a DTD, infinite recursion could
lead to an infinite loop or memory exhaustion.

Thanks to Wei Lei for the first of many reports.

Fixes bug 759579.
2017-07-25 15:21:12 +02:00
Nick Wellnhofer
872fea9485 Get rid of "blanks wrapper" for parameter entities
Now that replacement of parameter entities goes exclusively through
xmlSkipBlankChars, we can account for the surrounding space characters
there and remove the "blanks wrapper" hack.
2017-06-20 13:19:47 +02:00
Nick Wellnhofer
24246c7626 Fix xmlHaltParser
Pop all extra input streams before resetting the input. Otherwise,
a call to xmlPopInput could make input available again.

Also set input->end to input->cur.

Changes the test output for some error tests. Unfortunately, some
fuzzed test cases were added to the test suite without manual cleanup.
This makes it almost impossible to review the impact of later changes
on the test output.
2017-06-20 13:15:43 +02:00
Nick Wellnhofer
8bbe4508ef Spelling and grammar fixes
Fixes bug 743172, bug 743489, bug 769632, bug 782400 and a few other
misspellings.
2017-06-17 16:34:23 +02:00
Nick Wellnhofer
5f440d8cad Rework entity boundary checks
Make sure to finish all entities in the internal subset. Nevertheless,
readd a sanity check in xmlParseStartTag2 that was lost in my previous
commit. Also add a sanity check in xmlPopInput. Popping an input
unexpectedly was the source of many recent memory bugs. The check
doesn't mitigate such issues but helps with diagnosis.

Always base entity boundary checks on the input ID, not the input
pointer. The pointer could have been reallocated to the old address.

Always throw a well-formedness error if a boundary check fails. In a
few places, a validity error was thrown.

Fix a few error codes and improve indentation.
2017-06-17 13:25:53 +02:00
Nick Wellnhofer
dbaab1f369 Test SAX2 callbacks with entity substitution
This detects regressions like bug 760367.
2017-06-16 21:38:57 +02:00
Nick Wellnhofer
67f9f9d6c8 Misc fixes for 'make tests'
- Silence test output.
- Clean up after doc/examples tests.
- Adjust expected output for script tests.
- Add missing results for relaxng/pattern3

There are still two test failures I can't comment on:

- regexp/bug316338
- schemas/any4_0
2017-06-12 19:46:56 +02:00
Nick Wellnhofer
0b2d5c48e3 Initialize keepBlanks in HTML parser
This caused failures in the HTML push tests but the fix required to
change the expected output of the HTML SAX tests.
2017-06-12 19:11:54 +02:00
David Kilzer
85c112a082 Add test cases for bug 758518
test/HTML/758518-entity.html exposed a bug in pushParseTest() in
runtest.c which assumed that an input file was at least 4 bytes long.
That test case is only 3 bytes, so we now take the minimum of 4 bytes
or the length of the test input.  We also now use 'chunkSize' in place
of the hard-coded value '1024' later in the function.
2017-06-12 18:26:11 +02:00
Nick Wellnhofer
79c8a6b105 Print error messages for truncated UTF-8 sequences
Before, truncated UTF-8 sequences at the end of a file were treated as
EOF. Create an error message containing the offending bytes.

xmlStringCurrentChar would also print characters from the input stream,
not the string it's working on.
2017-06-10 18:11:58 +02:00
Nick Wellnhofer
932cc9896a Fix buffer size checks in xmlSnprintfElementContent
xmlSnprintfElementContent failed to correctly check the available
buffer space in two locations.

Fixes bug 781333 (CVE-2017-9047) and bug 781701 (CVE-2017-9048).

Thanks to Marcel Böhme and Thuan Pham for the report.
2017-06-05 19:38:19 +02:00
Nick Wellnhofer
e26630548e Fix handling of parameter-entity references
There were two bugs where parameter-entity references could lead to an
unexpected change of the input buffer in xmlParseNameComplex and
xmlDictLookup being called with an invalid pointer.

Percent sign in DTD Names
=========================

The NEXTL macro used to call xmlParserHandlePEReference. When parsing
"complex" names inside the DTD, this could result in entity expansion
which created a new input buffer. The fix is to simply remove the call
to xmlParserHandlePEReference from the NEXTL macro. This is safe because
no users of the macro require expansion of parameter entities.

- xmlParseNameComplex
- xmlParseNCNameComplex
- xmlParseNmtoken

The percent sign is not allowed in names, which are grammatical tokens.

- xmlParseEntityValue

Parameter-entity references in entity values are expanded but this
happens in a separate step in this function.

- xmlParseSystemLiteral

Parameter-entity references are ignored in the system literal.

- xmlParseAttValueComplex
- xmlParseCharDataComplex
- xmlParseCommentComplex
- xmlParsePI
- xmlParseCDSect

Parameter-entity references are ignored outside the DTD.

- xmlLoadEntityContent

This function is only called from xmlStringLenDecodeEntities and
entities are replaced in a separate step immediately after the function
call.

This bug could also be triggered with an internal subset and double
entity expansion.

This fixes bug 766956 initially reported by Wei Lei and independently by
Chromium's ClusterFuzz, Hanno Böck, and Marco Grassi. Thanks to everyone
involved.

xmlParseNameComplex with XML_PARSE_OLD10
========================================

When parsing Names inside an expanded parameter entity with the
XML_PARSE_OLD10 option, xmlParseNameComplex would call xmlGROW via the
GROW macro if the input buffer was exhausted. At the end of the
parameter entity's replacement text, this function would then call
xmlPopInput which invalidated the input buffer.

There should be no need to invoke GROW in this situation because the
buffer is grown periodically every XML_PARSER_CHUNK_SIZE characters and,
at least for UTF-8, in xmlCurrentChar. This also matches the code path
executed when XML_PARSE_OLD10 is not set.

This fixes bugs 781205 (CVE-2017-9049) and 781361 (CVE-2017-9050).
Thanks to Marcel Böhme and Thuan Pham for the report.

Additional hardening
====================

A separate check was added in xmlParseNameComplex to validate the
buffer size.
2017-06-05 18:38:33 +02:00
Nick Wellnhofer
7482f41f61 Check for integer overflow in xmlXPathFormatNumber
Check for overflow before casting double to int.

Found with afl-fuzz and UBSan.
2017-06-01 22:00:19 +02:00
Nick Wellnhofer
855c19efb7 Avoid reparsing in xmlParseStartTag2
The code in xmlParseStartTag2 must handle the case that the input
buffer was grown and reallocated which can invalidate pointers to
attribute values. Before, this was handled by detecting changes of
the input buffer "base" pointer and, in case of a change, jumping
back to the beginning of the function and reparsing the start tag.

The major problem of this approach is that whether an input buffer is
reallocated is nondeterministic, resulting in seemingly random test
failures. See the mailing list thread "runtest mystery bug: name2.xml
error case regression test" from 2012, for example.

If a reallocation was detected, the code also made no attempts to
continue parsing in case of errors which makes a difference in
the lax "recover" mode.

Now we store the current input buffer "base" pointer for each (not
separately allocated) attribute in the namespace URI field, which isn't
used until later. After the whole start tag was parsed, the pointers
to the attribute values are reconstructed using the offset between the
new and the old input buffer. This relies on arithmetic on dangling
pointers which is technically undefined behavior. But it seems like
the easiest and most efficient fix and a similar approach is used in
xmlParserInputGrow.

This changes the error output of several tests, typically making it
more verbose because we try harder to continue parsing in case of
errors.

(Another possible solution is to check not only the "base" pointer
but the size of the input buffer as well. But this would result in
even more reparsing.)
2017-06-01 14:31:28 +02:00
Nick Wellnhofer
f4029cd413 Check XPath exponents for overflow
Avoid undefined behavior and wrong results with huge exponents.

Found with afl-fuzz and UBSan.
2017-05-31 16:04:37 +02:00
Nick Wellnhofer
a58331a6ee Check for overflow in xmlXPathIsPositionalPredicate
Avoid undefined behavior when casting from double to int.

Found with afl-fuzz and UBSan.
2017-05-31 16:04:26 +02:00
Nick Wellnhofer
a851868a75 Parse small XPath numbers more accurately
Don't count leading zeros towards the fraction size limit. This allows
to parse numbers like

    0.0000000000000000000000000000000000000000000000000000000001

which is the only standard-conformant way to represent such numbers, as
scientific notation isn't allowed in XPath 1.0. (It is allowed in XPath
2.0 and in libxml2 as an extension, though.)

Overall accuracy is still bad, see bug 783238.
2017-05-31 15:46:29 +02:00
Nick Wellnhofer
4bebb030db Rework XPath rounding functions
Use the C library's floor and ceil functions. The old code was overly
complicated for no apparent reason and could result in undefined
behavior when handling NaNs (found with afl-fuzz and UBSan).

Fix wrong comment in xmlXPathRoundFunction. The implementation was
already following the spec and rounding half up.
2017-05-31 15:38:42 +02:00
Nick Wellnhofer
40f5852149 Fix axis traversal from attribute and namespace nodes
When traversing the "preceding" axis from an attribute node, we must
first go up to the attribute's containing element. Otherwise, text
children of other attributes could be returned. This made it possible
to hit a code path in xmlXPathNextAncestor which contained another bug:
The attribute node was initialized with the context node instead of the
current node. Normally, this code path is only hit via
xmlXPathNextAncestorOrSelf in which case the current and context node
are the same.

The combination of the two bugs could result in an infinite loop, found
with libFuzzer.

Traversing the "following" and the "preceding" axis from namespace nodes
should be handled similarly. This wasn't supported at all previously.
2017-05-31 14:57:46 +02:00
Nick Wellnhofer
9ab01a277d Fix XPointer paths beginning with range-to
The old code would invoke the broken xmlXPtrRangeToFunction. range-to
isn't really a function but a special kind of location step. Remove
this function and always handle range-to in the XPath code.

The old xmlXPtrRangeToFunction could also be abused to trigger a
use-after-free error with the potential for remote code execution.

Found with afl-fuzz.

Fixes CVE-2016-5131.
2016-10-12 13:12:18 +02:00
Nick Wellnhofer
d8083bf779 Fix NULL pointer deref in XPointer range-to
- Check for errors after evaluating first operand.
- Add sanity check for empty stack.

Found with afl-fuzz.
2016-06-25 14:24:51 +02:00
Pranjal Jumde
0bcd05c5cd Heap-based buffer overread in htmlCurrentChar
For https://bugzilla.gnome.org/show_bug.cgi?id=758606

* parserInternals.c:
(xmlNextChar): Add an test to catch other issues on ctxt->input
corruption proactively.
For non-UTF-8 charsets, xmlNextChar() failed to check for the end
of the input buffer and would continuing reading.  Fix this by
pulling out the check for the end of the input buffer into common
code, and return if we reach the end of the input buffer
prematurely.
* result/HTML/758606.html: Added.
* result/HTML/758606.html.err: Added.
* result/HTML/758606.html.sax: Added.
* result/HTML/758606_2.html: Added.
* result/HTML/758606_2.html.err: Added.
* result/HTML/758606_2.html.sax: Added.
* test/HTML/758606.html: Added test case.
* test/HTML/758606_2.html: Added test case.
2016-05-23 15:01:07 +08:00
David Kilzer
0090675905 Heap-based buffer-underreads due to xmlParseName
For https://bugzilla.gnome.org/show_bug.cgi?id=759573

* parser.c:
(xmlParseElementDecl): Return early on invalid input to fix
non-minimized test case (759573-2.xml).  Otherwise the parser
gets into a bad state in SKIP(3) at the end of the function.
(xmlParseConditionalSections): Halt parsing when hitting invalid
input that would otherwise caused xmlParserHandlePEReference()
to recurse unexpectedly.  This fixes the minimized test case
(759573.xml).

* result/errors/759573-2.xml: Add.
* result/errors/759573-2.xml.err: Add.
* result/errors/759573-2.xml.str: Add.
* result/errors/759573.xml: Add.
* result/errors/759573.xml.err: Add.
* result/errors/759573.xml.str: Add.
* test/errors/759573-2.xml: Add.
* test/errors/759573.xml: Add.
2016-05-23 15:01:07 +08:00
Pranjal Jumde
38eae57111 Heap use-after-free in xmlSAX2AttributeNs
For https://bugzilla.gnome.org/show_bug.cgi?id=759020

* parser.c:
(xmlParseStartTag2): Attribute strings are only valid if the
base does not change, so add another check where the base may
change.  Make sure to set 'attvalue' to NULL after freeing it.
* result/errors/759020.xml: Added.
* result/errors/759020.xml.err: Added.
* result/errors/759020.xml.str: Added.
* test/errors/759020.xml: Added test case.
2016-05-23 15:01:07 +08:00
Hugh Davenport
beca86e8c8 Detect change of encoding when parsing HTML names
From https://bugzilla.gnome.org/show_bug.cgi?id=758518

Happens when a file has a name getting parsed, but no valid encoding
set, so libxml has to guess what the encoding is. This patch detects
when the buffer location changes, and if it does, restarts the parsing
of the name.

This slightly change a couple of regression tests output
2016-05-23 15:01:07 +08:00
Pranjal Jumde
45752d2c33 Bug 759398: Heap use-after-free in xmlDictComputeFastKey <https://bugzilla.gnome.org/show_bug.cgi?id=759398>
* parser.c:
(xmlParseNCNameComplex): Store start position instead of a
pointer to the name since the underlying buffer may change,
resulting in a stale pointer being used.
* result/errors/759398.xml: Added.
* result/errors/759398.xml.err: Added.
* result/errors/759398.xml.str: Added.
* test/errors/759398.xml: Added test case.
2016-05-23 15:01:07 +08:00
Pranjal Jumde
a820dbeac2 Bug 758605: Heap-based buffer overread in xmlDictAddString <https://bugzilla.gnome.org/show_bug.cgi?id=758605>
Reviewed by David Kilzer.

* HTMLparser.c:
(htmlParseName): Add bounds check.
(htmlParseNameComplex): Ditto.
* result/HTML/758605.html: Added.
* result/HTML/758605.html.err: Added.
* result/HTML/758605.html.sax: Added.
* runtest.c:
(pushParseTest): The input for the new test case was so small
(4 bytes) that htmlParseChunk() was never called after
htmlCreatePushParserCtxt(), thereby creating a false positive
test failure.  Fixed by using a do-while loop so we always call
htmlParseChunk() at least once.
* test/HTML/758605.html: Added.
2016-05-23 15:01:07 +08:00
David Kilzer
db07dd613e Bug 758588: Heap-based buffer overread in xmlParserPrintFileContextInternal <https://bugzilla.gnome.org/show_bug.cgi?id=758588>
* parser.c:
(xmlParseEndTag2): Add bounds checks before dereferencing
ctxt->input->cur past the end of the buffer, or incrementing the
pointer past the end of the buffer.

* result/errors/758588.xml: Add test result.
* result/errors/758588.xml.err: Ditto.
* result/errors/758588.xml.str: Ditto.
* test/errors/758588.xml: Add regression test.
2016-05-23 15:01:07 +08:00
Nick Wellnhofer
6eb0894a96 Fix memory leak with XPath namespace nodes
Set hasNsNodes to 1 when adding namespace nodes via XP_TEST_HIT.
2016-05-05 17:38:27 +02:00
Nick Wellnhofer
82b73039dc Fix namespace axis traversal
When the namespace axis is traversed in "toBool" mode, the traversal
can exit early, before visiting all nodes. In this case, the XPath
context still contains a non-NULL tmpNsList.

This means that

- the check when to start a new traversal was wrong and
- the tmpNsList could be leaked.

Fixes bug #750037 and, by accident, bug #756075:

https://bugzilla.gnome.org/show_bug.cgi?id=750037
https://bugzilla.gnome.org/show_bug.cgi?id=756075
2016-05-05 15:30:00 +02:00
Nick Wellnhofer
839689a9a8 Don't recurse into OP_VALUEs in xmlXPathOptimizeExpression
The ch1 slot of OP_VALUEs contains an invalid value. Ignore it.

Fixes bug #760325:

https://bugzilla.gnome.org/show_bug.cgi?id=760325
2016-04-27 18:05:06 +02:00
Nick Wellnhofer
f39fd66ea7 Fix namespace::node() XPath expression
Make sure that xmlXPathNodeSetAddNs is called for namespace nodes when
matched with a namespace::node() step. This correctly sets the parent
of namespace nodes. Note that xmlXPathNodeSetAddNs must only be called
if working on the namespace axis. Otherwise, the context node is not
the parent of the namespace node and the standard XP_TEST_HIT macro
must be invoked. This explains the errors in the C14N tests that the
old TODO comment mentioned.
2016-04-27 11:21:35 +02:00
Nick Wellnhofer
e289390362 Fix parsing of NCNames in XPath
The NCName parser would allow any NameChar as start character. For
example, the following XPath expressions would compile:

    self::-abc
    self::0abc
    self::.abc
2016-04-23 19:12:47 +02:00
Audric Schiltknecht
cad102b861 Do normalize string-based datatype value in RelaxNG facet checking
Original patch is from Jan Pokorný <jpokorny redhat com>
https://mail.gnome.org/archives/xml/2013-November/msg00028.html

Improve it according to reviews and add test files.
2016-04-15 22:41:24 +08:00
David Kilzer
5be1a6e8e0 Bug 760861: REGRESSION (bf9c1dad): Missing results for test/schemas/regexp-char-ref_[01].xsd <https://bugzilla.gnome.org/show_bug.cgi?id=760861>
Add missing test results to fix the following errors when
running "make Schemastests":

    ## Schemas regression tests
    diff: ./result/schemas/regexp-char-ref_0_0.err: No such file or directory
    diff: ./result/schemas/regexp-char-ref_1_0.err: No such file or directory

* result/schemas/regexp-char-ref_0_0.err: Added.
* result/schemas/regexp-char-ref_1_0.err: Added.
2016-04-08 10:33:09 +08:00
David Kilzer
49bbfdb6c9 Add missing RNG test files
For https://bugzilla.gnome.org/show_bug.cgi?id=760249

Add missing test results from Bug 710744 for commit
6473a41a49.
2016-04-08 10:20:22 +08:00
David Kilzer
4f8606c13c Bug 760183: REGRESSION (v2.9.3): XML push parser fails with bogus UTF-8 encoding error when multi-byte character in large CDATA section is split across buffer <https://bugzilla.gnome.org/show_bug.cgi?id=760183>
* parser.c:
(xmlCheckCdataPush): Add 'complete' argument to describe whether
the buffer passed in is the whole CDATA buffer, or if there is
more data to parse.  If there is more data to parse, don't
return a negative value for an invalid multi-byte UTF-8
character that is split between buffers.
(xmlParseTryOrFinish): Pass 'complete' argument to
xmlCheckCdataPush() as appropriate.

* result/cdata-2-byte-UTF-8.xml: Added.
* result/cdata-2-byte-UTF-8.xml.rde: Added.
* result/cdata-2-byte-UTF-8.xml.rdr: Added.
* result/cdata-2-byte-UTF-8.xml.sax: Added.
* result/cdata-2-byte-UTF-8.xml.sax2: Added.
* result/cdata-3-byte-UTF-8.xml: Added.
* result/cdata-3-byte-UTF-8.xml.rde: Added.
* result/cdata-3-byte-UTF-8.xml.rdr: Added.
* result/cdata-3-byte-UTF-8.xml.sax: Added.
* result/cdata-3-byte-UTF-8.xml.sax2: Added.
* result/cdata-4-byte-UTF-8.xml: Added.
* result/cdata-4-byte-UTF-8.xml.rde: Added.
* result/cdata-4-byte-UTF-8.xml.rdr: Added.
* result/cdata-4-byte-UTF-8.xml.sax: Added.
* result/cdata-4-byte-UTF-8.xml.sax2: Added.
* result/noent/cdata-2-byte-UTF-8.xml: Added.
* result/noent/cdata-3-byte-UTF-8.xml: Added.
* result/noent/cdata-4-byte-UTF-8.xml: Added.
* test/cdata-2-byte-UTF-8.xml: Added.
* test/cdata-3-byte-UTF-8.xml: Added.
* test/cdata-4-byte-UTF-8.xml: Added.
- Add tests and results.  Only 'make Readertests XMLPushtests'
  fails prior to the fix.
2016-04-08 10:18:52 +08:00
Daniel Veillard
a7a94612aa Heap-based buffer overread in xmlNextChar
For https://bugzilla.gnome.org/show_bug.cgi?id=759671

when the end of the internal subset isn't properly detected
xmlParseInternalSubset should just return instead of trying
to process input further.
2016-02-09 12:55:29 +01:00
Daniel Veillard
f1063fdbe7 CVE-2015-7500 Fix memory access error due to incorrect entities boundaries
For https://bugzilla.gnome.org/show_bug.cgi?id=756525
handle properly the case where we popped out of the current entity
while processing a start tag
Reported by Kostya Serebryany @ Google

This slightly modifies the output of 754946 in regression tests
2015-11-20 16:06:59 +08:00
Daniel Veillard
4a5d80aded Fix a bug in CData error handling in the push parser
For https://bugzilla.gnome.org/show_bug.cgi?id=754947

The checking function was returning incorrect args in some cases
Adds the test to teh reg suite and fix one of the existing test output
2015-09-18 15:06:46 +08:00
Daniel Veillard
51f02b0a03 Fix a bug on name parsing at the end of current input buffer
For https://bugzilla.gnome.org/show_bug.cgi?id=754946

When hitting the end of the current input buffer while parsing
a name we could end up loosing the beginning of the name, which
led to various issues.
2015-09-15 16:50:32 +08:00
Daniel Veillard
ef709ce2f7 Fix the spurious ID already defined error
For https://bugzilla.gnome.org/show_bug.cgi?id=737840
the fix for 724903 introduced a regression on external entities carrying
IDs, revert that patch in part and add a specific test to avoid readding it
2015-09-10 19:46:46 +08:00
Daniel Veillard
2fab235d10 Fix support for except in nameclasses
For https://bugzilla.gnome.org/show_bug.cgi?id=565219

The code was imply missing even if simple, added a few regression
tests.
2015-03-16 08:43:37 +08:00
Nick Wellnhofer
02b252d7a2 Regression test for bug #695699 2015-03-08 17:00:37 +01:00
Nick Wellnhofer
342658a132 Add a couple of XPath tests 2015-03-08 16:46:04 +01:00
Nick Wellnhofer
f6aaabce85 Allow attributes on descendant-or-self axis
If the context node is an attribute, the attribute itself is on the
descendant-or-self axis. The principal node type of this axis is element,
so the only node test that can return the attribute is "node()". In other
words, "@attr/descendant-or-self::node()" is equivalent to "@attr".

This matches the behavior of Saxon-CE.
2015-03-08 16:25:52 +01:00
Daniel Veillard
df23f584fd Adding example from bugs 738805 to regression tests
For https://bugzilla.gnome.org/show_bug.cgi?id=738805

Tortuous test case provided by pierre.labastie@neuf.fr
2014-10-23 13:52:47 +08:00
Shaun McCance
6473a41a49 Implement choice for name classes on attributes
https://bugzilla.gnome.org/show_bug.cgi?id=710744
2013-11-28 16:09:00 +08:00
Daniel Veillard
dcc1950319 Fix a parsing bug on non-ascii element and CR/LF usage
https://bugzilla.gnome.org/show_bug.cgi?id=698550

Somehow the behaviour of the internal parser routine changed
slightly when encountering CR/LF, which led to a bug when
parsing document with non-ascii Names
2013-05-22 22:56:45 +02:00
Daniel Veillard
483272f3f0 Added a regression tests from bug 694228 data
Provided by Mark Rowe <mrowe@apple.com>
2013-03-27 13:37:14 +08:00
Daniel Veillard
a3f1e3e571 Avoid extra processing on entities
If an entity has already been checked for correctness no
need to check it on every reference
2013-03-11 15:59:21 +08:00
Daniel Veillard
a7982ce272 Adding streaming validation to runtest checks 2012-10-25 15:39:39 +08:00
Daniel Veillard
f933c89813 Keep non-significant blanks node in HTML parser
For https://bugzilla.gnome.org/show_bug.cgi?id=681822

Regardless if the option HTML_PARSE_NOBLANKS is set or not, blank nodes
are removed from a HTML document, for example:

<html>
  <head>
    <title>This is a test.</title>
  </head>
  <body>
    <p>This is a test.</p>
  </body>
</html>

is read as:

<html><head><title>This is a test.</title></head><body>
    <p>This is a test.</p>
  </body></html>

This changes the default behaviour but the old behaviour is available
as expected when using the parser flag HTML_PARSE_NOBLANKS

Based on original patch from Igor Ignatyuk <igor_ignatiouk@hotmail.com>

* HTMLparser.c: change various places in the parser where ignorable_space
  SAX callback was called without checking for the parser flag preference
* xmllint.c: make sure we use the new flag even for HTML parsing
* result/HTML/*: this modifies the output of a number of tests
2012-09-07 19:32:12 +08:00
Daniel Veillard
e7bf892d8c Improve error reporting on parser errors
The extra string was being dismissed when provided.
* parser.c: handle bot case properly
* result/: this changes a few error reports
2012-07-30 20:09:25 +08:00
Daniel Veillard
4629ee02ac Do not fetch external parsed entities
Unless explicietely asked for when validating or replacing entities
with their value. Problem pointed out by Tom Lane <tgl@redhat.com>

* parser.c: do not load external parsed entities unless needed
* test/errors/extparsedent.xml result/errors/extparsedent.xml*:
  add a regression test to avoid change of the behaviour in the future
2012-07-23 14:15:40 +08:00
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
Daniel Veillard
6974feb0cf fixed the comment streaming bug raised by Graham Bennett added to the
* parser.c: fixed the comment streaming bug raised by Graham Bennett
* test/badcomment.xml result//badcomment.xml*: added to the regression suite.
Daniel
2006-02-05 02:43:36 +00:00
Daniel Veillard
a617e24f32 reverted first patches for #319279 which led to #326295 and fixed the
* parser.c: reverted first patches for #319279 which led to #326295
  and fixed the problem in xmlParseChunk() instead
* test/ent11 result//ent11*: added test for #326295 to the regression
  suite
Daniel
2006-01-09 14:38:44 +00:00
Kasimier T. Buchcik
bb2074e8ff Added regression tests for the latest XPath/pattern fixes.
* test/XPath/docs/nodes test/XPath/tests/nodespat
  result/XPath/tests/nodespat: Added regression tests for
  the latest XPath/pattern fixes.
2006-01-05 14:49:40 +00:00
Daniel Veillard
6977c6c437 fix bug #324432 with <xml:foo/> added to the regression tests Daniel
* SAX2.c: fix bug #324432 with <xml:foo/>
* test/ns7 resul//ns7*: added to the regression tests
Daniel
2006-01-04 14:03:10 +00:00
Kasimier T. Buchcik
b0d74c661a Added regression test for bug #321475 (reported by Gabor Nagy). Fixing of
* test/schemas/bug321475* result/schemas/bug321475*:
  Added regression test for bug #321475 (reported by
  Gabor Nagy). Fixing of bug #323510 seemed to have
  fixed this bug as well.
2005-12-13 11:52:35 +00:00
Kasimier T. Buchcik
183fa3e79a Added regression test for bug #323510.
* test/schemas/bug323510* result/schemas/bug323510*:
  Added regression test for bug #323510.
2005-12-12 15:20:28 +00:00
Kasimier T. Buchcik
7c78215b14 Added missing regression test results for the latest IDC and xs:decimal
* result/schemas/decimal* result/schemas/bug322411*:
  Added missing regression test results for the latest IDC
  and xs:decimal bugs.
2005-12-02 12:52:47 +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
Daniel Veillard
fc6eca0d81 fix bug #319897, problem with counted atoms when the transition itself is
* xmlregexp.c: fix bug #319897, problem with counted atoms
  when the transition itself is counted too
* result/regexp/hard test/regexp/hard: augmented the regression
  tests with the problem exposed.
Daniel
2005-11-01 15:24:02 +00:00
Aleksey Sanin
b2eabc0c44 fixed bug in exc-c14n namespace visibility + test case 319367(bug #319367) 2005-10-28 03:15:18 +00:00
Daniel Veillard
b990008f05 script HTML parser error fix, corrects bug #319715 added test from Michael
* HTMLparser.c: script HTML parser error fix, corrects bug #319715
* result/HTML/53867* test/HTML/53867.html: added test from Michael Day
  to the regression suite
Daniel
2005-10-25 12:36:29 +00:00
Kasimier T. Buchcik
95c3adf57a Adapted regression test results.
* result/schemas/*.err: Adapted regression test results.
2005-10-14 14:41:35 +00:00
Kasimier T. Buchcik
748cebc25f Adapted regression test results 2005-10-10 13:36:27 +00:00
Kasimier T. Buchcik
56cbbf2d82 Adapted result.
* result/schemas/derivation-ok-extension_0_0: Adapted result.
2005-09-12 19:31:53 +00:00
Kasimier T. Buchcik
cf0123d352 Adapted regression results.
* result/schemas/allsg_0_3.err result/schemas/allsg_0_4.err
  result/schemas/changelog093_1_0.err
  result/schemas/derivation-ok-extension_0_0.err
  result/schemas/import1_0_0.err
  result/schemas/derivation-ok-restriction-2-1-1_0_0.err:
  Adapted regression results.
2005-09-12 19:24:59 +00:00
Daniel Veillard
dbd6105321 applied second patch from David Madore to be less intrusive when handling
* xmlsave.c: applied second patch from David Madore to be less intrusive
  when handling scripts and style elements in XHTML1 should fix #316041
* test/xhtml1 result//xhtml1\*: updated the test accordingly
Daniel
2005-09-12 14:03:26 +00:00
Daniel Veillard
36d73403ff Applied the last patch from Gary Coady for #304637 changing the behaviour
* HTMLparser.c: Applied the last patch from Gary Coady for #304637
  changing the behaviour when text nodes are found in body
* result/HTML/*: this changes the output of some tests
Daniel
2005-09-01 09:52:30 +00:00
Daniel Veillard
b6580aef14 uninitialized field and fix on test. Daniel
* debugXML.c result/XPath/xptr/strrange2: uninitialized field and
  fix on test.
Daniel
2005-08-25 14:18:56 +00:00
Daniel Veillard
cfa303ac70 change verbosity depending on API get back to previous outputs Daniel
* debugXML.c: change verbosity depending on API
* result/XPath/tests/* result/XPath/xptr/* result/xmlid/*: get back
  to previous outputs
Daniel
2005-08-25 14:03:56 +00:00
Daniel Veillard
8874b94cd2 added a parser XML_PARSE_COMPACT option to allocate small text nodes (less
* HTMLparser.c parser.c SAX2.c debugXML.c tree.c valid.c xmlreader.c
  xmllint.c include/libxml/HTMLparser.h include/libxml/parser.h:
  added a parser XML_PARSE_COMPACT option to allocate small
  text nodes (less than 8 bytes on 32bits, less than 16bytes on 64bits)
  directly within the node, various changes to cope with this.
* result/XPath/tests/* result/XPath/xptr/* result/xmlid/*: this
  slightly change the output
Daniel
2005-08-25 13:19:21 +00:00
Daniel Veillard
53bd1f3c2c found another bug while looking at #309616 on missing entities. this
* parser.c: found another bug while looking at #309616 on missing
  entities.
* result/ent2.sax* result/ent7.sax* result/xml2.sax*: this changed the
  SAX stream in missing conditions for a few tests
Daniel
2005-08-24 14:46:07 +00:00
Daniel Veillard
9668826368 fixed bug #170489 reported by Jirka Kosek added the test to the regression
* parser.c: fixed bug #170489 reported by Jirka Kosek
* test/valid/objednavka.xml test/valid/dtds/objednavka.dtd
  result/valid/objednavka*: added the test to the regression suite.
Daniel
2005-08-23 18:14:12 +00:00
Daniel Veillard
ccb4d41c13 regenerated fixed a compilation problem some cleanups and one bug fix
* elfgcchack.h testapi.c doc/*: regenerated
* schematron.c: fixed a compilation problem
* xmlregexp.c include/libxml/xmlregexp.h: some cleanups and one bug fix
* result/expr/base: slightly changes the number of Cons.
Daniel
2005-08-23 13:41:17 +00:00
Daniel Veillard
4f917e2416 applied patch from Kuba Nowakowski fixing bug #313982 also added the test
* xmlschemastypes.c: applied patch from Kuba Nowakowski fixing bug
  #313982
* result/schemas/bug313982* test/schemas/bug313982*: also added
  the test case to the regression suite.
Daniel
2005-08-22 16:01:43 +00:00
Daniel Veillard
355a023866 added the first regression test suite set for the new expression support
* Makefile.am result/expr/base test/expr/base: added the first
  regression test suite set for the new expression support
Daniel
2005-08-22 12:58:05 +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
60faf528d8 fixed bug #307377 about validation of choices in list values. added
* relaxng.c: fixed bug #307377 about validation of choices in
  list values.
* test/relaxng/307377* result/relaxng/307377* Makefile.am runtest.c:
  added examples to the regression tests, problem is that streaming
  version gives slightly more informations.
Daniel
2005-08-10 16:23:57 +00:00
Kasimier T. Buchcik
ea7e4798c4 Added missing test results.
* result/schemas/any6_1_0*: Added missing test results.
2005-08-10 10:37:47 +00:00
Daniel Veillard
4f82c8a161 fixed a determinism detection problem exposed by ##other tests commited by
* xmlregexp.c: fixed a determinism detection problem exposed by
  ##other tests commited by Kasimier, also added a small speedup
  of determinism detection.
* test/results/any6_2_0* any8_1_0* any7_1_2* any7_2_2*: added
  the results to the regression tests now
Daniel
2005-08-09 21:40:08 +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
Daniel Veillard
6e65e15777 trying to nail down the remaining ##other issues completed the tests and
* xmlregexp.c xmlschemas.c: trying to nail down the remaining
  ##other issues
* result/schemas/any7* test/schemas/any7: completed the tests
  and added the results
* result/schemas/any3_0_0.err result/schemas/any5_0_0.err
  result/schemas/any5_1_0.err: this slightly chnages the output
  from 3 existing tests
Daniel
2005-08-09 11:09:52 +00:00
Daniel Veillard
b8c8016044 fixed bug #310333 with a patch close to the provided patch for HTML UTF-8
* HTMLtree.c: fixed bug #310333 with a patch close to the provided
  patch for HTML UTF-8 serialization
* result/HTML/script2.html: this changed the output of that test
Daniel
2005-08-08 13:46:45 +00:00
Daniel Veillard
10752284e3 fixed bug #310264, basically it's about reentrancy of count based
* xmlregexp.c: fixed bug #310264, basically it's about reentrancy
  of count based transition, when going though the counter must
  be reset to 0
* test/schemas/bug310264* result/schemas/bug310264*: added the
  regression test.
Daniel
2005-08-08 13:05:13 +00:00
Daniel Veillard
d541c8f8b4 report improvement more tests Daniel
* schematron.c: report improvement
* test/schematron/zvon* result/schematron/zvon*: more tests
Daniel
2005-07-31 16:49:51 +00:00
Daniel Veillard
5fe95a8fd9 applied patch from Rob Richards to add schematron to the build on Windows
* win32/Makefile.msvc win32/configure.js: applied patch from Rob
  Richards to add schematron to the build on Windows
* test/schematron/zvon3* result/schematron/zvon3*: second test
* test/schematron/zvon10* result/schematron/zvon10*: this is the
  real second test 10 and 2 are swapped.
Daniel
2005-07-31 14:05:18 +00:00
Daniel Veillard
eaecb3eab2 more bug fixes, improve the error reporting. second test Daniel
* schematron.c: more bug fixes, improve the error reporting.
* test/schematron/zvon2* result/schematron/zvon2*: second test
Daniel
2005-07-31 13:43:14 +00:00
Daniel Veillard
c740a17f45 fixing the loop bug, fixing schematron text error rendering started
* schematron.c xmllint.c: fixing the loop bug, fixing schematron
  text error rendering
* Makefile.am result/schematron/* test/schematron/zvon1*.sct:
  started integrating within "make tests"
Daniel
2005-07-31 12:17:24 +00:00
Kasimier T. Buchcik
11162b7ce7 Added creation of the content type of xs:anyType. This is needed when
* xmlschemastypes.c: Added creation of the content type of
  xs:anyType. This is needed when trying to extend xs:anyType
  (although it makes no sense to extend it; IMHO the schema
  people should have ruled this out). This was reported
  by Yong Chen to the mailing list.
* xmlschemas.c: Fixed handling of xs:anyType in
  xmlSchemaCheckCOSCTExtends() (reported by Young Chen). Tiny
  adjustment to an error report output.
* test/schemas/extension2* result/schemas/extension2*:
  Added a test case provided by Young Chen.
2005-07-28 00:50:22 +00:00
Daniel Veillard
77005e6ff0 fixed the error reporting for not transitions fixed output Daniel
* xmlregexp.c xmlschemas.c: fixed the error reporting for
  not transitions
* result/schemas/any5_0_0* result/schemas/any5_0_2*
  result/schemas/any5_1_0*: fixed output
Daniel
2005-07-19 16:26:18 +00:00
Daniel Veillard
9efc476bb6 fixing bug #172215 about foreign namespaces by adding support for negated
* xmlregexp.c xmlschemas.c include/libxml/xmlautomata.h: fixing
  bug #172215 about foreign namespaces by adding support for
  negated string transitions. Error messages still need to be
  improved.
* test/schemas/any5* result/schemas/any5*: adding regression
  tests for this.
Daniel
2005-07-19 14:33:55 +00:00
Daniel Veillard
a980befc8f fixed xsd:all when used in conjunction with substitution groups adding
* xmlschemas.c: fixed xsd:all when used in conjunction with
  substitution groups
* test/schemas/allsg_* result/schemas/allsg_*: adding specific
  regression tests, strangely missing from NIST/Sun/Microsoft
  testsuites
Daniel
2005-07-18 21:34:03 +00:00
Daniel Veillard
358fef4b1e applied UTF-8 script parsing bug #310229 fix from Jiri Netolicky added the
* HTMLparser.c: applied UTF-8 script parsing bug #310229 fix from
  Jiri Netolicky
* result/HTML/script2.html* test/HTML/script2.html: added the test
  case from the regression suite
Daniel
2005-07-13 16:37:38 +00:00
William M. Brack
f810de0436 fixed problem with free on dupl attribute in dtd (bug309637). added
* parser.c: fixed problem with free on dupl attribute in
  dtd (bug309637).
* test/errors/attr3.xml, result/errors/attr3.*: added
  regression test for this
2005-07-06 22:48:41 +00:00
Daniel Veillard
abac41e829 fixing bug #166777 (and #169838), it was an heuristic in areBlanks which
* parser.c: fixing bug #166777 (and #169838), it was an heuristic
  in areBlanks which failed.
* result/winblanks.xml* result/noent/winblanks.xml test/winblanks.xml:
  added the input file to the regression tests
Daniel
2005-07-06 15:17:38 +00:00
Kasimier T. Buchcik
6d30ff2c08 Fixed bug #309338, reported by Kupriyanov Anotolij. Added a regression
* xmlschemastypes.c: Fixed bug #309338, reported by Kupriyanov
  Anotolij.
* test/schemas/bug309338* result/schemas/bug309338*:
  Added a regression test for the above bug.
2005-07-06 11:44:51 +00:00
Daniel Veillard
3fa5e7e44c fixed a bug failing to detect UTF-8 violations in CData in push mode.
* parser.c: fixed a bug failing to detect UTF-8 violations in
  CData in push mode.
* result/errors/cdata.xml* test/errors/cdata.xml: added the test
  to the regressions
Daniel
2005-07-04 11:12:25 +00:00
Daniel Veillard
597f1c1f34 applied patch from James Bursa fixing an html parsing bug in push mode
* HTMLparser.c: applied patch from James Bursa fixing an html parsing
  bug in push mode
* result/HTML/repeat.html* test/HTML/repeat.html: added the test to the
  regression suite
Daniel
2005-07-03 23:00:18 +00:00
Daniel Veillard
dbee0f1989 working some weird error reporting problem for DTD validation. augmented
* error.c valid.c: working some weird error reporting problem for
  DTD validation.
* runtest.c: augmented with DTD validation tests
* result/VC/OneID*: slight change in validation output.
Daniel
2005-06-27 13:42:57 +00:00
Daniel Veillard
4a5a964c66 added SAXv2 regression tests apparently missing. added SAX1/SAX2 checks.
* result/*.sax2 MAkefile.am: added SAXv2 regression tests apparently
  missing.
* runtest.c: added SAX1/SAX2 checks.
Daniel
2005-06-27 10:40:55 +00:00
Kasimier T. Buchcik
21edf9b42c Added regression tests (from Dhyanesh).
* test/schemas/empty-value* result/schemas/empty-value*:
  Added regression tests (from Dhyanesh).
2005-06-21 08:46:25 +00:00
Kasimier T. Buchcik
ef1b6676f6 Added schema test results (Tom Browder, bug #306806).
* result/schemas/bug306806_1_0 result/schemas/bug306806_1_0.err:
  Added schema test results (Tom Browder, bug #306806).
2005-06-15 09:15:11 +00:00
Daniel Veillard
f46440392e fixed a bug exposed by Rob Richards in the mailing-list added the
* relaxng.c: fixed a bug exposed by Rob Richards in the mailing-list
* result//compare0* test//compare0*: added the regression test in
  the suite as this went unnoticed !
Daniel
2005-06-13 11:41:31 +00:00
William M. Brack
ea152c05b3 Further enhancement for XPath streaming, consolidated with schemas usage
* pattern.c, xpath.c, include/libxml/pattern.h: Further
  enhancement for XPath streaming, consolidated with
  schemas usage of pattern.c.  Added a new enum
  xmlPatternFlags.
* doc/*, testapi.c, elfgcchack.h: updated to reflect new
  enum.
* test/XPath/tests/mixedpat, test/XPath/docs/mixed,
  result/XPath/mixedpat: added regression test for problems
  reported in bug306348
2005-06-09 18:12:28 +00:00
Kasimier T. Buchcik
828f654769 Fixed an attribute fixed/default value constraint error.
* xmlschemas.c result/schemas/include1_0_0.err:
  Fixed an attribute fixed/default value constraint error.
2005-06-09 11:23:39 +00:00
Kasimier T. Buchcik
21f63b0347 Adapted regression test results 2005-06-09 10:48:40 +00:00
Daniel Veillard
365cf67ff8 applied patch from Malcolm Rowe to avoid namespace troubles on rollback
* parser.c: applied patch from Malcolm Rowe to avoid namespace
  troubles on rollback parsing of elements start #304761
* test/nsclean.xml result/noent/nsclean.xml result/nsclean.xml*:
  added it to the regression tests.
Daniel
2005-06-09 08:18:24 +00:00
Kasimier T. Buchcik
bd6c3f7df8 Fixed facet errors to be channelled back for union type members;
* xmlschemas.c: Fixed facet errors to be channelled back for
  union type members; facet-validation will stop now on the
  first error. Reported by GUY Fabrice to the mailing-list.
* xmlschemastypes.c: Changed to ignore lengh-related facet
  validation for QNames and NOTATIONs as proposed by the
  schema people.
* test/schemas/union2* result/schemas/union2*: Added
  regression tests for union types (by GUY Fabrice).
2005-05-25 17:29:36 +00:00
Kasimier T. Buchcik
3eec790cdc Added regression a test provided by Heiko Oberdiek (bug #303566).
* test/schemas/bug303566_1* result/schemas/bug303566_1_1*:
  Added regression a test provided by Heiko Oberdiek (bug #303566).

  level for XML Schema IDCs (bug #303566 reported by Heiko Oberdiek).
  This should not affect pattern-like resolution on every level.
2005-05-10 09:16:19 +00:00
Kasimier T. Buchcik
eabc1d6558 Added test results.
* result/schemas/changelog093*: Added test results.
2005-04-18 11:04:28 +00:00
Daniel Veillard
4ddaa56d7a fixed the bug in lang() as raised by Elliotte Rusty Harold added a
* xpath.c: fixed the bug in lang() as raised by Elliotte Rusty Harold
* result/XPath/tests/langsimple test/XPath/tests/langsimple
  test/XPath/docs/lang: added a regression test
Daniel
2005-04-06 14:09:08 +00:00
Kasimier T. Buchcik
256401b2bd Committing again, since the CVS server aborted.
* xmlschemas.c include/libxml/schemasInternals.h
  result/schemas/src-element2-*.err result/schemas/element-*.err:
  Committing again, since the CVS server aborted.
2005-04-01 15:36:42 +00:00
Daniel Veillard
63d68a37be fixed a problem in Relax-NG validation #159968 added the test to the
* relaxng.c: fixed a problem in Relax-NG validation #159968
* test/relaxng/list.* result/relaxng/list_*: added the test
  to the regression suite
Daniel
2005-03-31 13:50:00 +00:00
Kasimier T. Buchcik
b474fa409c The schema parser will stop if components could not be resolved. This is
* xmlschemas.c: The schema parser will stop if components could
  not be resolved. This is not conforming to the spec but for now
  will avoid internal errors during type fixup and content model
  creation. Restructured inclusion/import of schemata: this avoids
  duplicate, self and circular inclusion. Chameleon includes are
  still workarounded. Added restriction to disallow references to
  non-imported namespaces. Corrected parsing of <group>.
* result/schemas/bug167754_0_0*: Added a missing test result.
2005-03-11 12:34:42 +00:00
Kasimier T. Buchcik
25799cee8d Added IDC evaluation for attribute nodes. Made 'nil'ed elements work.
* xmlschemas.c: Added IDC evaluation for attribute nodes.
  Made 'nil'ed elements work. Added a specific error message
  for 'strict' attribute wildcards.
* include/libxml/xmlerror.h: Added an error code for
  wildcards.
* result/schemas/anyAttr-processContents-err1_0_0.err: Adapted.
2005-02-15 14:39:48 +00:00
Daniel Veillard
2b2e02d6bb fixed implementation for | added a specific regression test Daniel
* pattern.c xmllint.c: fixed implementation for |
* test/pattern/conj.* result/pattern/conj: added a specific regression
  test
Daniel
2005-02-05 23:20:22 +00:00
Daniel Veillard
0996a162c9 fixed the namespaces support fixed xmlGetNodePath when namespaces are used
* pattern.c: fixed the namespaces support
* tree.c: fixed xmlGetNodePath when namespaces are used
* result/pattern/multiple result/pattern/namespaces
  test/pattern/multiple.* test/pattern/namespaces.*: added
  more regression tests
Daniel
2005-02-05 14:00:10 +00:00
Daniel Veillard
f9d169142d added first test for the patterns a few fixes Daniel
* Makefile.am configure.in result/pattern/simple
  test/pattern/simple.*: added first test for the patterns
* pattern.c xmllint.c: a few fixes
Daniel
2005-01-30 22:36:30 +00:00
Daniel Veillard
8f8a9dd7f1 found and fixed 2 problems in the internal subset scanning code affecting
* parser.c: found and fixed 2 problems in the internal subset scanning
  code affecting the push parser (and the reader), fixes #165126
* test/intsubset2.xml result//intsubset2.xml*: added the test case
  to the regression tests.
Daniel
2005-01-25 21:41:42 +00:00
Daniel Veillard
4c778d8b96 boosting common commnent parsing code, it was really slow. added sprecific
* parser.c: boosting common commnent parsing code, it was really
  slow.
* test/comment[3-5].xml result//comment[3-5].xml*: added sprecific
  regression tests
Daniel
2005-01-23 17:37:44 +00:00
Daniel Veillard
b8590d4c1a fixed bug #164556 where non-fatal errors stopped push parsing and
* parser.c: fixed bug #164556 where non-fatal errors stopped
  push parsing and xmlreader.
* Makefile.am: fixup
* test/errors/webdav.xml result/errors/webdav*: adding regression
  test for this problem.
Daniel
2005-01-21 15:10:23 +00:00
Daniel Veillard
9186a1fdb6 fixed bug #157633 in relaxng choice optimization added regression tests
* relaxng.c: fixed bug #157633 in relaxng choice optimization
* result/relaxng/choice0* test/relaxng/choice0*: added regression
  tests about it.
* doc/*: rebuilt
* testdso.c: removed a warning due to a missing void in signature.
Daniel
2005-01-15 12:38:10 +00:00
Kasimier T. Buchcik
31113c7e86 Exposed targetNamespace for simple/complex types, model groups, attribute
* include/libxml/schemasInternals.h xmlschemas.c:
  Exposed targetNamespace for simple/complex types, model groups,
  attribute groups and notations (reported by Michael Hewarth
  to the mailing list). Added targetNamespace to xmlSchemaType,
  xmlSchemaAttributeGroup and xmlSchemaNotation.
  Tiny cosmetic change to the content model error report output.
* result//all_*.err result//any3_0_0.err result//choice_*.err
  result//list0_0_1.err result//list0_1_1.err: Adapted output
  of regression tests.
2005-01-13 16:57:20 +00:00
Kasimier T. Buchcik
c3af19d1f7 Integrated xmlRegExecErrInfo and xmlRegExecNextValues from xmlregexp.c to
* xmlschemas.c: Integrated xmlRegExecErrInfo and xmlRegExecNextValues
  from xmlregexp.c to report expected elements on content model errors.
* all_*.err any3_0_0.err choice_*.err list0_0_1.err list0_1_1.err:
  Adapted output of regression tests.
2005-01-13 12:10:11 +00:00
Daniel Veillard
48df9613ba fixed namespace bug in push mode reported by Rob Richards added it to the
* parser.c: fixed namespace bug in push mode reported by
  Rob Richards
* test/ns6 result//ns6*: added it to the regression tests
* xmlmodule.c testModule.c include/libxml/xmlmodule.h:
  added an extra option argument to module opening and defined
  a couple of flags to the API.
Daniel
2005-01-04 21:50:05 +00:00
Kasimier T. Buchcik
8b41817d58 tiny enhancement for content model error reports (#157190, #143948).
* xmlschemas.c: tiny enhancement for content model error reports (#157190, #143948).
  Removed abbreviations: CT, ST and WC (#157190, reported by Frans  Englich).
  Initial: no report of local components.
* result/schemas/all* result/schemas/any3_0_0.err result/schemas/choice*
  result/schemas/cos-st-restricts-1-2-err_0_0.err result/schemas/derivation-ok-extension-err_0_0.err
  result/schemas/derivation-ok-extension_0_0.err result/schemas/derivation-ok-restriction-2-1-1_0_0.err
  result/schemas/derivation-ok-restriction-4-1-err_0_0.err result/schemas/deter0_0_0.err
  result/schemas/extension1_0_2.err result/schemas/facet-unionST-err1_0_0.err
  result/schemas/hexbinary_0_1.err result/schemas/list* result/schemas/restriction-attr1_0_0.err
  result/schemas/vdv-first4_0_1.err result/schemas/vdv-first4_0_2.err: Adapted output.
2004-11-17 13:14:27 +00:00
Daniel Veillard
370ba3d231 fixed the leak reported by Volker Roth on the list added a specific test
* parser.c: fixed the leak reported by Volker Roth on the list
* test/ent10 result//ent10*: added a specific test for the problem
Daniel
2004-10-25 16:23:56 +00:00
Daniel Veillard
fc484dd0a0 added support for HTML PIs #156087 added specific tests Daniel
* HTMLparser.c: added support for HTML PIs #156087
* test/HTML/python.html result/HTML/python.html*: added specific tests
Daniel
2004-10-22 14:34:23 +00:00
Daniel Veillard
807b4de282 applied patch from Malcolm Tredinnick fixing errata E20 concerning
* valid.c TODO: applied patch from Malcolm Tredinnick fixing errata
  E20 concerning NMTOKENS and co. validation #153722
* result/VC/AttributeNmtokens test/VC/AttributeNmtokens
  test/VCM/AttributeNmtokens.xml: also added tests from Malcolm
Daniel
2004-09-26 14:42:56 +00:00
Kasimier T. Buchcik
876a6db193 Simpified attribute wildcard creation and assignment to get rid of memory
* xmlschemas.c include/libxml/schemasInternals.h
  test/schemas/bug152470_1.* result/schemas/bug152470_1_1*:
  Simpified attribute wildcard creation and assignment to get rid
  of memory leaks.
  Restructured the validation process.
  Restructured and expanded parsing of <attributeGroup>.
  Added initial handing of xsi:type.
  Advanced handling of xsi:nil (should work now for simple types).
  Added construction of schemata using xsi:schemaLocation and
  xsi:noNamespaceSchemaLocation; this is not enabled, since
  no corresponding API exists yet.
  Moved the content model to complex type components.
  Resolution of types for attributes will look for simple types
  only (incl. all the built-in simple types).
  Extended parsing of 'anyAttribute'.
  Fixed content-type type for complex types if derived from
  'anyType' using the short-hand form (see bug # 152470,
  submitted by Thilo Jeremias).
* include/libxml/xmlschematypes.h: Cleaned up some comments.
* xstc/xstc.py: Workaround to accomodate case insensitive
  test definitions in ms-test.def.xml.
* result/schemas/deter0_0_0.err result/schemas/ns0_0_2.err
  result/schemas/ns0_1_2.err: Adapted.
2004-09-16 11:31:52 +00:00
Daniel Veillard
f34a20e69d "" is a valid hexbinary string dixit xmlschema-dev update the test. added
* xmlschemastypes.c: "" is a valid hexbinary string dixit xmlschema-dev
* result/schemas/hexbinary_0_1.err test/schemas/hexbinary_1.xml:
  update the test.
* test/ns5 result//ns5*: added a test for the namespace bug fixed
  in previous commit.
* Makefile.am: added a message in the regression tests
Daniel
2004-08-31 08:42:17 +00:00
Kasimier T. Buchcik
bea2354a33 Added missing test file. Substituted the obsolete xmlSchemaValidError(s)
* test/schemas/import-bad-1_0.imp: Added missing test file.
* xmlschemas.c include/libxml/xmlerror.h include/libxml/xmlschemas.h:
  Substituted the obsolete xmlSchemaValidError(s) for xmlParserErrors
  - see #150840.
  Changed the import of schemas to allow failure of location
  of a resource to be imported.
* result/schemas/all_* result/schemas/any3_0_0.err
  result/schemas/choice_* result/schemas/import1_0_0.err
  result/schemas/list0_0_1.err result/schemas/list0_1_0.err
  result/schemas/list0_1_1.err result/schemas/ns0_0_2.err
  result/schemas/ns0_1_2.err: Adapted regression test results.
2004-08-25 20:35:45 +00:00
William M. Brack
2f2a66324d modified parsing of <list>, <union>, <restriction>, <sequence>, <choice>,
* xmlschemas.c: modified parsing of <list>, <union>, <restriction>,
  <sequence>, <choice>, <include>, <import>.
  Fixed schema defaults (elementFormDefault, etc.) for included
  schemas.
  Fixed a bug which reported attributes as invalid on
  elements declarations with the built-in type 'anyType'.
  Added "lax" validation of the content of elements of type
  'anyType'.
  Fixed: element declarations with the same name were treated
  as duplicate if located in the subtree of <choice> -> <sequence>.
  (This was bug 150623, submitted by Roland Lezuo)
  Fixed cleanup of error codes in xmlSchemaValidateDoc as proposed
  by Igor Kapitanker. (This was bug 150647, submitted by Igor
  Kapitanker)
* xmlschemastypes.c: Changed the type of anyType to
  XML_SCHEMAS_ANYTYPE.
* include/libxml/xmlerror.h: Added schema parser errors.
* result/schemas/bug145246_0_0*
  result/schemas/extension1_0_2.err: Changed test results.
* result/schemas/ct-sc-nobase_0_0*
  result/schemas/facet-whiteSpace_0_0*
  result/schemas/import1_0_0* result/schemas/import2_0_0*
  result/schemas/include2_0_0* result/schemas/include3_0_0*
  result/schemas/restriction-attr1_0_0*
  result/schemas/seq-dubl-elem1_0_0*
  result/schemas/xsd-list-itemType_0_0*: Added new rest results.
  test/schemas/bug145246.xsd.imp test/schemas/ct-sc-nobase_0*
  test/schemas/facet-whiteSpace_0* test/schemas/import1_0*
  test/schemas/import2_0* test/schemas/include2_0*
  test/schemas/include3_0* test/schemas/restriction-attr1_0*
  test/schemas/seq-dubl-elem1_0* test/schemas/xml.xsd
  test/schemas/xsd-list-itemType_0*: Added new tests and missing
  files.
2004-08-20 23:09:47 +00:00
Daniel Veillard
29b1748205 small typo pointed out by Mike Hommey slightly improved the --c14n
* xmlIO.c: small typo pointed out by Mike Hommey
* doc/xmllint.xml, xmllint.html, xmllint.1: slightly improved
  the --c14n description, c.f. #144675 .
* nanohttp.c nanoftp.c: applied a first simple patch from
  Mike Hommey for $no_proxy, c.f. #133470
* parserInternals.c include/libxml/parserInternals.h
  include/libxml/xmlerror.h: cleanup to avoid 'error' identifier
  in includes #
* parser.c SAX2.c debugXML.c include/libxml/parser.h:
  first version of the inplementation of parsing within
  the context of a node in the tree #142359, new function
  xmlParseInNodeContext(), added support at the xmllint --shell
  level as the "set" function
* test/scripts/set* result/scripts/* Makefile.am: extended
  the script based regression tests to instrument the new function.
Daniel
2004-08-16 00:39:03 +00:00
Daniel Veillard
c0826a7709 applied Schemas patches from Kasimier Buchcik lot of new tests for things
* configure.in xmlregexp.c xmlschemas.c xmlschemastypes.c
  include/libxml/schemasInternals.h include/libxml/xmlerror.h
  include/libxml/xmlschemastypes.h: applied Schemas patches
  from Kasimier Buchcik
* test/ result/ bug141333* annot-err* any[1-4]* bug145246*
  element-err* element-minmax-err* include1* restrict-CT-attr-ref*:
  lot of new tests for things fixed by the patch
Daniel
2004-08-10 14:17:33 +00:00