Commit 5151c06f authored by Daniel Veillard's avatar Daniel Veillard
Browse files

fixed an erroneous validation bug when PE refs occurs in external parsed

* parser.c: fixed an erroneous validation bug when PE refs
  occurs in external parsed entities referenced from the
  internals subset
* test/valid/index.xml test/valid/dtds/nitf-2-5.dtd
  test/valid/dtds/NewsMLv1.0.dtd result/valid/index.xml*:
  added the associated testcase, it's a nice one.
* HTMLparser.c: generate the DTD node as HTML still ...
* HTMLtree.c: fixed errors in Set/GetMetaEncoding
Daniel
parent b6b0fd89
Tue Oct 23 14:32:04 CEST 2001 Daniel Veillard <daniel@veillard.com>
* parser.c: fixed an erroneous validation bug when PE refs
occurs in external parsed entities referenced from the
internals subset
* test/valid/index.xml test/valid/dtds/nitf-2-5.dtd
test/valid/dtds/NewsMLv1.0.dtd result/valid/index.xml*:
added the associated testcase, it's a nice one.
* HTMLparser.c: generate the DTD node as HTML still ...
* HTMLtree.c: fixed errors in Set/GetMetaEncoding
Mon Oct 22 14:20:17 CEST 2001 Daniel Veillard <daniel@veillard.com>
* HTMLparser.c: fixed a bug in htmlNewDoc()
......
......@@ -1823,7 +1823,7 @@ htmlNewDocNoDtD(const xmlChar *URI, const xmlChar *ExternalID) {
cur->_private = NULL;
if ((ExternalID != NULL) ||
(URI != NULL))
xmlCreateIntSubset(cur, BAD_CAST "html", ExternalID, URI);
xmlCreateIntSubset(cur, BAD_CAST "HTML", ExternalID, URI);
return(cur);
}
......
......@@ -54,7 +54,7 @@ htmlGetMetaEncoding(htmlDocPtr doc) {
* Search the html
*/
while (cur != NULL) {
if (cur->name != NULL) {
if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) {
if (xmlStrEqual(cur->name, BAD_CAST"html"))
break;
if (xmlStrEqual(cur->name, BAD_CAST"head"))
......@@ -72,7 +72,7 @@ htmlGetMetaEncoding(htmlDocPtr doc) {
* Search the head
*/
while (cur != NULL) {
if (cur->name != NULL) {
if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) {
if (xmlStrEqual(cur->name, BAD_CAST"head"))
break;
if (xmlStrEqual(cur->name, BAD_CAST"meta"))
......@@ -90,7 +90,7 @@ found_head:
*/
found_meta:
while (cur != NULL) {
if (cur->name != NULL) {
if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) {
if (xmlStrEqual(cur->name, BAD_CAST"meta")) {
xmlAttrPtr attr = cur->properties;
int http;
......@@ -180,7 +180,7 @@ htmlSetMetaEncoding(htmlDocPtr doc, const xmlChar *encoding) {
* Search the html
*/
while (cur != NULL) {
if (cur->name != NULL) {
if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) {
if (xmlStrcasecmp(cur->name, BAD_CAST"html") == 0)
break;
if (xmlStrcasecmp(cur->name, BAD_CAST"head") == 0)
......@@ -198,7 +198,7 @@ htmlSetMetaEncoding(htmlDocPtr doc, const xmlChar *encoding) {
* Search the head
*/
while (cur != NULL) {
if (cur->name != NULL) {
if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) {
if (xmlStrcasecmp(cur->name, BAD_CAST"head") == 0)
break;
if (xmlStrcasecmp(cur->name, BAD_CAST"meta") == 0)
......@@ -237,7 +237,7 @@ found_meta:
* encoding informations
*/
while (cur != NULL) {
if (cur->name != NULL) {
if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) {
if (xmlStrcasecmp(cur->name, BAD_CAST"meta") == 0) {
xmlAttrPtr attr = cur->properties;
int http;
......
......@@ -2085,7 +2085,8 @@ xmlParseEntityValue(xmlParserCtxtPtr ctxt, xmlChar **orig) {
ctxt->wellFormed = 0;
ctxt->disableSAX = 1;
}
if ((ctxt->inSubset == 1) && (tmp == '%')) {
if ((tmp == '%') && (ctxt->inSubset == 1) &&
(ctxt->inputNr == 1)) {
ctxt->errNo = XML_ERR_ENTITY_PE_INTERNAL;
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
......
This diff is collapsed.
......@@ -17,7 +17,6 @@
Based on RSS DTD originally created by
Lars Marius Garshol - larsga@ifi.uio.no.
$Id: rss.xml,v 1.1 2001/04/20 13:48:21 veillard Exp $
--><!ELEMENT rss (channel)>
<!ATTLIST rss version CDATA #REQUIRED>
......
./test/valid/rss.xml:178: validity error: Element rss doesn't carry attribute version
./test/valid/rss.xml:177: validity error: Element rss doesn't carry attribute version
</rss>
^
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE NewsML PUBLIC "urn:newsml:iptc.org:20001006:NewsMLv1.0:1" "dtds/NewsMLv1.0.dtd" [
<!ENTITY % nitf SYSTEM "dtds/nitf-2-5.dtd">
%nitf;
]>
<NewsML>
<Catalog Href="http://www.afp.com/dtd/AFPCatalog.xml"/>
<NewsEnvelope>
<DateAndTime>20011022T154508Z</DateAndTime>
</NewsEnvelope>
<NewsItem>
<Identification>
<NewsIdentifier>
<ProviderId>afp.com</ProviderId>
<DateId>20011022</DateId>
<NewsItemId>mmd--deutsch--journal--spo</NewsItemId>
<RevisionId PreviousRevision="0" Update="N">1</RevisionId>
<PublicIdentifier>urn:NewsML:afp.com:20011022:mmd--deutsch--journal--spo:1</PublicIdentifier>
</NewsIdentifier>
<NameLabel>HINTERGRUND</NameLabel>
</Identification>
<NewsManagement>
<NewsItemType FormalName="News"/>
<FirstCreated>20011022T154508Z</FirstCreated>
<ThisRevisionCreated>20011022T154508Z</ThisRevisionCreated>
<Status FormalName="Usable"/>
</NewsManagement>
<NewsComponent>
<AdministrativeMetadata>
<Provider>
<Party FormalName="AFP"/>
</Provider>
</AdministrativeMetadata>
<DescriptiveMetadata>
<Language FormalName="de"/>
</DescriptiveMetadata>
<NewsComponent>
<NewsLines>
<HeadLine>Berliner SPD fhrt Gesprche mit FDP und Grnen</HeadLine>
</NewsLines>
<NewsItemRef NewsItem="011022154450.sq80bp9h.xml"/>
</NewsComponent>
<NewsComponent>
<NewsLines>
<HeadLine>INFOGRAFIK: Das Berliner Wahlergebnis</HeadLine>
</NewsLines>
<NewsItemRef NewsItem="011022113032.remo00m7.xml"/>
</NewsComponent>
<NewsComponent>
<NewsLines>
<HeadLine>Schwierige Koalitionsverhandlungen in Berlin</HeadLine>
</NewsLines>
<NewsItemRef NewsItem="011022124314.9hv2kozk.xml"/>
</NewsComponent>
<NewsComponent>
<NewsLines>
<HeadLine>Die Lieblingsfarben des Kanzlers sind Rot Gelb Grn</HeadLine>
</NewsLines>
<NewsItemRef NewsItem="011022134541.cmmaoim7.xml"/>
</NewsComponent>
<NewsComponent>
<NewsLines>
<HeadLine>INFOGRAFIK: Wen whlt Wowereit?</HeadLine>
</NewsLines>
<NewsItemRef NewsItem="011022122545.hl3z2as6.xml"/>
</NewsComponent>
<NewsComponent>
<NewsLines>
<HeadLine>CDU ist auch in kommunalen Rathusern der Verlierer</HeadLine>
</NewsLines>
<NewsItemRef NewsItem="011022120205.b8sykfvu.xml"/>
</NewsComponent>
<NewsComponent>
<NewsLines>
<HeadLine>Gutes Abschneiden der PDS hat verschiedene Grnde</HeadLine>
</NewsLines>
<NewsItemRef NewsItem="011022134159.agvne048.xml"/>
</NewsComponent>
<NewsComponent>
<NewsLines>
<HeadLine>Ans Regieren hat sich Klaus Wowereit gewhnt</HeadLine>
</NewsLines>
<NewsItemRef NewsItem="011021161031.1oq7qyub.xml"/>
</NewsComponent>
<NewsComponent>
<NewsLines>
<HeadLine>Steffel brachte CDU nicht auf Erfolgskurs</HeadLine>
</NewsLines>
<NewsItemRef NewsItem="011021165007.kt9qog9m.xml"/>
</NewsComponent>
<NewsComponent>
<NewsLines>
<HeadLine>Sibyll Klotz: Vollblutpolitikerin mit "Berliner Schnauze"</HeadLine>
</NewsLines>
<NewsItemRef NewsItem="011021184658.lctevest.xml"/>
</NewsComponent>
<NewsComponent>
<NewsLines>
<HeadLine>Mit Gysi muss weiter gerechnet werden</HeadLine>
</NewsLines>
<NewsItemRef NewsItem="011021180441.6tpvgx0y.xml"/>
</NewsComponent>
<NewsComponent>
<NewsLines>
<HeadLine>Rexrodt - das Stehaufmnnchen der Berliner FDP</HeadLine>
</NewsLines>
<NewsItemRef NewsItem="011021165558.gujrz59m.xml"/>
</NewsComponent>
</NewsComponent>
</NewsItem>
</NewsML>
......@@ -17,7 +17,6 @@
Based on RSS DTD originally created by
Lars Marius Garshol - larsga@ifi.uio.no.
$Id: rss-0.91.dtd,v 1.1 1999/07/25 07:59:31 danda Exp $
-->
<!ELEMENT rss (channel)>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment