fixed a problem in push mode when attribute contains unescaped '>'

* parser.c: fixed a problem in push mode when attribute contains
  unescaped '>' characters, fixes bug #134566
* test/att6 result//att6*: added the test to the regression suite
Daniel
This commit is contained in:
Daniel Veillard 2004-02-18 14:28:22 +00:00
parent 965983a5d5
commit b37440047e
7 changed files with 63 additions and 1 deletions

View File

@ -1,3 +1,9 @@
Wed Feb 18 15:20:42 CET 2004 Daniel Veillard <daniel@veillard.com>
* parser.c: fixed a problem in push mode when attribute contains
unescaped '>' characters, fixes bug #134566
* test/att6 result//att6*: added the test to the regression suite
Tue Feb 17 17:26:31 CET 2004 Daniel Veillard <daniel@veillard.com> Tue Feb 17 17:26:31 CET 2004 Daniel Veillard <daniel@veillard.com>
* valid.c: removing a non-linear behaviour from ID/IDREF raised * valid.c: removing a non-linear behaviour from ID/IDREF raised

View File

@ -9030,7 +9030,8 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
} }
if (!terminate) { if (!terminate) {
if (ctxt->progressive) { if (ctxt->progressive) {
if ((lastgt == NULL) || (ctxt->input->cur > lastgt)) /* > can be found unescaped in attribute values */
if ((lastlt == NULL) || (ctxt->input->cur >= lastlt))
goto done; goto done;
} else if (xmlParseLookupSequence(ctxt, '>', 0, 0) < 0) { } else if (xmlParseLookupSequence(ctxt, '>', 0, 0) < 0) {
goto done; goto done;

6
result/att6 Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Invoice xmlns:ccts="urn:oasis:names:tc:ubl:CoreComponentParameters:1.0:0.70" xmlns:cct="urn:oasis:names:tc:ubl:CoreComponentTypes:1.0:0.70" xmlns:cat="urn:oasis:names:tc:ubl:CommonAggregateTypes:1.0:0.70" xmlns="urn:oasis:names:tc:ubl:Invoice:1.0:0.70">
<cat:ReferencedOrder>
<cat:SellersOrderID schemeID="pvalue-&gt;ReferencedOrder.SellersOrderID.schemeID" schemeAgencyID="pvalue-&gt;ReferencedOrder.SellersOrderID.schemeAgencyID" schemeVersionID="pvalue-&gt;ReferencedOrder.SellersOrderID.schemeVersionID" schemeAgencySchemeID="pvalue-&gt;ReferencedOrder.SellersOrderID.schemeAgencySchemeID" schemeAgencySchemeAgencyID="pvalue-&gt;ReferencedOrder.SellersOrderID.schemeAgencySchemeAgencyID" schemeDataURI="pvalue-&gt;ReferencedOrder.SellersOrderID.schemeDataURI" schemeURI="pvalue-&gt;ReferencedOrder.SellersOrderID.schemeURI" UID="pvalue-&gt;ReferencedOrder.SellersOrderID.UID" UIDRef="pvalue-&gt;ReferencedOrder.SellersOrderID.UIDRef" UIDRefs="pvalue-&gt;ReferencedOrder.SellersOrderID.UIDRefs0" language="pvalue-&gt;ReferencedOrder.SellersOrderID.language">pvalue-&gt;ReferencedOrder.SellersOrderID</cat:SellersOrderID>
</cat:ReferencedOrder>
</Invoice>

15
result/att6.rdr Normal file
View File

@ -0,0 +1,15 @@
0 1 Invoice 0 0
1 14 #text 0 1
1 1 cat:ReferencedOrder 0 0
2 14 #text 0 1
2 1 cat:SellersOrderID 0 0
3 3 #text 0 1 pvalue->ReferencedOrder.SellersOrderID
2 15 cat:SellersOrderID 0 0
2 14 #text 0 1
1 15 cat:ReferencedOrder 0 0
1 14 #text 0 1
0 15 Invoice 0 0

22
result/att6.sax Normal file
View File

@ -0,0 +1,22 @@
SAX.setDocumentLocator()
SAX.startDocument()
SAX.startElement(Invoice, xmlns:ccts='urn:oasis:names:tc:ubl:CoreComponentParameters:1.0:0.70', xmlns:cct='urn:oasis:names:tc:ubl:CoreComponentTypes:1.0:0.70', xmlns:cat='urn:oasis:names:tc:ubl:CommonAggregateTypes:1.0:0.70', xmlns='urn:oasis:names:tc:ubl:Invoice:1.0:0.70')
SAX.characters(
, 4)
SAX.startElement(cat:ReferencedOrder)
SAX.characters(
, 7)
SAX.getEntity(gt)
SAX.startElement(cat:SellersOrderID, schemeID='pvalue->ReferencedOrder.SellersOrderID.schemeID', schemeAgencyID='pvalue->ReferencedOrder.SellersOrderID.schemeAgencyID', schemeVersionID='pvalue->ReferencedOrder.SellersOrderID.schemeVersionID', schemeAgencySchemeID='pvalue->ReferencedOrder.SellersOrderID.schemeAgencySchemeID', schemeAgencySchemeAgencyID='pvalue->ReferencedOrder.SellersOrderID.schemeAgencySchemeAgencyID', schemeDataURI='pvalue->ReferencedOrder.SellersOrderID.schemeDataURI', schemeURI='pvalue->ReferencedOrder.SellersOrderID.schemeURI', UID='pvalue->ReferencedOrder.SellersOrderID.UID', UIDRef='pvalue->ReferencedOrder.SellersOrderID.UIDRef', UIDRefs='pvalue->ReferencedOrder.SellersOrderID.UIDRefs0', language='pvalue->ReferencedOrder.SellersOrderID.language')
SAX.characters(pvalue-, 7)
SAX.getEntity(gt)
SAX.characters(>, 1)
SAX.characters(ReferencedOrder.SellersOrderID, 30)
SAX.endElement(cat:SellersOrderID)
SAX.characters(
, 4)
SAX.endElement(cat:ReferencedOrder)
SAX.characters(
, 1)
SAX.endElement(Invoice)
SAX.endDocument()

6
result/noent/att6 Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Invoice xmlns:ccts="urn:oasis:names:tc:ubl:CoreComponentParameters:1.0:0.70" xmlns:cct="urn:oasis:names:tc:ubl:CoreComponentTypes:1.0:0.70" xmlns:cat="urn:oasis:names:tc:ubl:CommonAggregateTypes:1.0:0.70" xmlns="urn:oasis:names:tc:ubl:Invoice:1.0:0.70">
<cat:ReferencedOrder>
<cat:SellersOrderID schemeID="pvalue-&gt;ReferencedOrder.SellersOrderID.schemeID" schemeAgencyID="pvalue-&gt;ReferencedOrder.SellersOrderID.schemeAgencyID" schemeVersionID="pvalue-&gt;ReferencedOrder.SellersOrderID.schemeVersionID" schemeAgencySchemeID="pvalue-&gt;ReferencedOrder.SellersOrderID.schemeAgencySchemeID" schemeAgencySchemeAgencyID="pvalue-&gt;ReferencedOrder.SellersOrderID.schemeAgencySchemeAgencyID" schemeDataURI="pvalue-&gt;ReferencedOrder.SellersOrderID.schemeDataURI" schemeURI="pvalue-&gt;ReferencedOrder.SellersOrderID.schemeURI" UID="pvalue-&gt;ReferencedOrder.SellersOrderID.UID" UIDRef="pvalue-&gt;ReferencedOrder.SellersOrderID.UIDRef" UIDRefs="pvalue-&gt;ReferencedOrder.SellersOrderID.UIDRefs0" language="pvalue-&gt;ReferencedOrder.SellersOrderID.language">pvalue-&gt;ReferencedOrder.SellersOrderID</cat:SellersOrderID>
</cat:ReferencedOrder>
</Invoice>

6
test/att6 Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Invoice xmlns:ccts="urn:oasis:names:tc:ubl:CoreComponentParameters:1.0:0.70" xmlns:cct="urn:oasis:names:tc:ubl:CoreComponentTypes:1.0:0.70" xmlns:cat="urn:oasis:names:tc:ubl:CommonAggregateTypes:1.0:0.70" xmlns="urn:oasis:names:tc:ubl:Invoice:1.0:0.70">
<cat:ReferencedOrder>
<cat:SellersOrderID schemeID="pvalue->ReferencedOrder.SellersOrderID.schemeID" schemeAgencyID="pvalue->ReferencedOrder.SellersOrderID.schemeAgencyID" schemeVersionID="pvalue->ReferencedOrder.SellersOrderID.schemeVersionID" schemeAgencySchemeID="pvalue->ReferencedOrder.SellersOrderID.schemeAgencySchemeID" schemeAgencySchemeAgencyID="pvalue->ReferencedOrder.SellersOrderID.schemeAgencySchemeAgencyID" schemeDataURI="pvalue->ReferencedOrder.SellersOrderID.schemeDataURI" schemeURI="pvalue->ReferencedOrder.SellersOrderID.schemeURI" UID="pvalue->ReferencedOrder.SellersOrderID.UID" UIDRef="pvalue->ReferencedOrder.SellersOrderID.UIDRef" UIDRefs="pvalue-&gt;ReferencedOrder.SellersOrderID.UIDRefs0" language="pvalue->ReferencedOrder.SellersOrderID.language">pvalue-&gt;ReferencedOrder.SellersOrderID</cat:SellersOrderID>
</cat:ReferencedOrder>
</Invoice>