From 808a3f1f9f7c7e9eb4faba618d1efdfe6d20f7d8 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Thu, 17 Aug 2000 13:50:51 +0000 Subject: [PATCH] cleaned up the output of SAX tests, Daniel --- ChangeLog | 5 +++++ result/HTML/doc2.htm.sax | 8 ++++---- result/HTML/doc3.htm.sax | 8 ++++---- result/HTML/fp40.htm.sax | 2 +- result/HTML/wired.html.sax | 4 ++-- result/noent/title.xml | 2 +- result/title.xml | 2 +- test/title.xml | 1 + testHTML.c | 28 ++++++++++++---------------- testSAX.c | 25 +++++++++++-------------- 10 files changed, 42 insertions(+), 43 deletions(-) diff --git a/ChangeLog b/ChangeLog index c24a6dfc..0906f23f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Aug 17 15:50:00 CEST 2000 Daniel Veillard + + * testSAX.c testHTML.c result/HTML/: cleanup of the output + of SAX tests + Mon Aug 14 13:56:33 EDT 2000 Daniel Veillard * Patch from Albert Chin-A-Young : diff --git a/result/HTML/doc2.htm.sax b/result/HTML/doc2.htm.sax index 3d020526..ee807949 100644 --- a/result/HTML/doc2.htm.sax +++ b/result/HTML/doc2.htm.sax @@ -1,6 +1,6 @@ SAX.setDocumentLocator() SAX.startDocument() -SAX.internalSubset(HTML, -//W3C//DTD HTML 4.0 Transitional//EN, (null)) +SAX.internalSubset(HTML, -//W3C//DTD HTML 4.0 Transitional//EN, ) SAX.comment( saved from url=(0016)http://intranet/ ) SAX.comment( BEGIN Naviscope Javascript ) SAX.startElement(html) @@ -39,12 +39,12 @@ SAX.endElement(meta) SAX.endElement(head) SAX.startElement(body) SAX.startElement(frameset, border='false', cols='172,*', frameBorder='0', frameSpacing='0') -SAX.startElement(frame, marginHeight='0', marginWidth='0', name='left', noResize='(null)', scrolling='no', src='doc2_files/side.htm', target='rtop') +SAX.startElement(frame, marginHeight='0', marginWidth='0', name='left', noResize, scrolling='no', src='doc2_files/side.htm', target='rtop') SAX.endElement(frame) SAX.startElement(frameset, rows='43,*') -SAX.startElement(frame, marginHeight='0', marginWidth='0', name='rtop', noResize='(null)', scrolling='no', src='doc2_files/top.htm', target='rbottom') +SAX.startElement(frame, marginHeight='0', marginWidth='0', name='rtop', noResize, scrolling='no', src='doc2_files/top.htm', target='rbottom') SAX.endElement(frame) -SAX.startElement(frame, name='rbottom', noResize='(null)', src='doc2_files/contents.htm', target='_top') +SAX.startElement(frame, name='rbottom', noResize, src='doc2_files/contents.htm', target='_top') SAX.endElement(frame) SAX.endElement(frameset) SAX.startElement(noframes) diff --git a/result/HTML/doc3.htm.sax b/result/HTML/doc3.htm.sax index 17c6734e..4cb9ac4d 100644 --- a/result/HTML/doc3.htm.sax +++ b/result/HTML/doc3.htm.sax @@ -1,6 +1,6 @@ SAX.setDocumentLocator() SAX.startDocument() -SAX.internalSubset(HTML, -//W3C//DTD HTML 4.0 Transitional//EN, (null)) +SAX.internalSubset(HTML, -//W3C//DTD HTML 4.0 Transitional//EN, ) SAX.comment( saved from url=(0025)http://bp6.gamesquad.net/ ) SAX.comment( BEGIN Naviscope Javascript ) SAX.startElement(html) @@ -344,7 +344,7 @@ SAX.startElement(p, align='center') SAX.startElement(a, href='http://www.gentus.com/') SAX.error: error parsing attribute name SAX.error: htmlParseStartTag: problem parsing attributes -SAX.startElement(img, align='bottom', alt='Taking a first look at the Abit Linux release called ', border='0', height='45', src='doc3_files/gentusbox.gif', width='70', Gentus='(null)') +SAX.startElement(img, align='bottom', alt='Taking a first look at the Abit Linux release called ', border='0', height='45', src='doc3_files/gentusbox.gif', width='70', Gentus) SAX.error: Couldn't find end of Start Tag img SAX.characters(?.?>, 4) SAX.endElement(a) @@ -2591,7 +2591,7 @@ SAX.characters( , 14) SAX.endElement(font) SAX.startElement(center) -SAX.startElement(iframe, frameBorder='0', height='60', marginHeight='0', marginWidth='0', noResize='(null)', scrolling='no', src='doc3_files/ad_iframe.htm', width='468') +SAX.startElement(iframe, frameBorder='0', height='60', marginHeight='0', marginWidth='0', noResize, scrolling='no', src='doc3_files/ad_iframe.htm', width='468') SAX.startElement(a, href='http://ads.adflight.com/go_static.asp?asid=7708', target='_top') SAX.error: htmlParseEntityRef: expecting ';' SAX.error: htmlParseEntityRef: expecting ';' @@ -2758,7 +2758,7 @@ SAX.error: Opening and ending tag mismatch: b and noscript SAX.endElement(noscript) SAX.endElement(b) SAX.startElement(a, href='http://www.goto.com/d/search/ssn/?fromGIF=true', target='_blank') -SAX.startElement(img, align='bottom', border='0', height='90', isMap='(null)', src='doc3_files/100x90.gif', width='100') +SAX.startElement(img, align='bottom', border='0', height='90', isMap, src='doc3_files/100x90.gif', width='100') SAX.endElement(img) SAX.endElement(a) SAX.startElement(b) diff --git a/result/HTML/fp40.htm.sax b/result/HTML/fp40.htm.sax index 94d2c5c1..f181d622 100644 --- a/result/HTML/fp40.htm.sax +++ b/result/HTML/fp40.htm.sax @@ -1,6 +1,6 @@ SAX.setDocumentLocator() SAX.startDocument() -SAX.internalSubset(html, -//IETF//DTD HTML//EN, (null)) +SAX.internalSubset(html, -//IETF//DTD HTML//EN, ) SAX.startElement(html) SAX.characters( diff --git a/result/HTML/wired.html.sax b/result/HTML/wired.html.sax index 75b5cea8..d38d628f 100644 --- a/result/HTML/wired.html.sax +++ b/result/HTML/wired.html.sax @@ -49,7 +49,7 @@ SAX.characters( SAX.startElement(select, NAME='state') SAX.characters( , 2) -SAX.startElement(option, VALUE='WA', SELECTED='(null)') +SAX.startElement(option, VALUE='WA', SELECTED) SAX.characters(WA , 4) SAX.startElement(option, VALUE='AL') @@ -442,7 +442,7 @@ SAX.error: htmlParseEntityRef: expecting ';' SAX.error: htmlParseEntityRef: expecting ';' SAX.error: htmlParseEntityRef: expecting ';' SAX.error: htmlParseEntityRef: expecting ';' -SAX.startElement(option, value='http://search.hotwired.com/search97/s97.vts?Action=FilterSearch&Filter=docs_filter.hts&ResultTemplate=vignette.hts&Collection=vignette&QueryMode=Internet&Query=', selected='(null)') +SAX.startElement(option, value='http://search.hotwired.com/search97/s97.vts?Action=FilterSearch&Filter=docs_filter.hts&ResultTemplate=vignette.hts&Collection=vignette&QueryMode=Internet&Query=', selected) SAX.characters(Wired News, 10) SAX.endElement(option) SAX.characters( diff --git a/result/noent/title.xml b/result/noent/title.xml index 35c8fc9c..1b3fe07a 100644 --- a/result/noent/title.xml +++ b/result/noent/title.xml @@ -1,2 +1,2 @@ - + my title diff --git a/result/title.xml b/result/title.xml index 35c8fc9c..1b3fe07a 100644 --- a/result/title.xml +++ b/result/title.xml @@ -1,2 +1,2 @@ - + my title diff --git a/test/title.xml b/test/title.xml index d064d661..1b3fe07a 100644 --- a/test/title.xml +++ b/test/title.xml @@ -1 +1,2 @@ + my title diff --git a/testHTML.c b/testHTML.c index 721f0e51..d680cf03 100644 --- a/testHTML.c +++ b/testHTML.c @@ -143,20 +143,15 @@ void internalSubsetDebug(void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID) { - /* xmlDtdPtr externalSubset; */ - - fprintf(stdout, "SAX.internalSubset(%s, %s, %s)\n", - name, (ExternalID == NULL) ? "(null)" : ExternalID, - (SystemID == NULL) ? "(null)" : SystemID); - -/*********** - if ((ExternalID != NULL) || (SystemID != NULL)) { - externalSubset = xmlParseDTD(ExternalID, SystemID); - if (externalSubset != NULL) { - xmlFreeDtd(externalSubset); - } - } - ***********/ + fprintf(stdout, "SAX.internalSubset(%s,", name); + if (ExternalID == NULL) + fprintf(stdout, " ,"); + else + fprintf(stdout, " %s,", ExternalID); + if (SystemID == NULL) + fprintf(stdout, " )\n"); + else + fprintf(stdout, " %s)\n", SystemID); } /** @@ -372,8 +367,9 @@ startElementDebug(void *ctx, const xmlChar *name, const xmlChar **atts) fprintf(stdout, "SAX.startElement(%s", (char *) name); if (atts != NULL) { for (i = 0;(atts[i] != NULL);i++) { - fprintf(stdout, ", %s='", atts[i++]); - fprintf(stdout, "%s'", (atts[i] == NULL) ? "(null)" : atts[i]); + fprintf(stdout, ", %s", atts[i++]); + if (atts[i] != NULL) + fprintf(stdout, "='%s'", atts[i]); } } fprintf(stdout, ")\n"); diff --git a/testSAX.c b/testSAX.c index fc1f573e..7f3870ab 100644 --- a/testSAX.c +++ b/testSAX.c @@ -142,19 +142,15 @@ void internalSubsetDebug(void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID) { - /* xmlDtdPtr externalSubset; */ - - fprintf(stdout, "SAX.internalSubset(%s, %s, %s)\n", - name, ExternalID, SystemID); - -/*********** - if ((ExternalID != NULL) || (SystemID != NULL)) { - externalSubset = xmlParseDTD(ExternalID, SystemID); - if (externalSubset != NULL) { - xmlFreeDtd(externalSubset); - } - } - ***********/ + fprintf(stdout, "SAX.internalSubset(%s,", name); + if (ExternalID == NULL) + fprintf(stdout, " ,"); + else + fprintf(stdout, " %s,", ExternalID); + if (SystemID == NULL) + fprintf(stdout, " )\n"); + else + fprintf(stdout, " %s)\n", SystemID); } /** @@ -371,7 +367,8 @@ startElementDebug(void *ctx, const xmlChar *name, const xmlChar **atts) if (atts != NULL) { for (i = 0;(atts[i] != NULL);i++) { fprintf(stdout, ", %s='", atts[i++]); - fprintf(stdout, "%s'", atts[i]); + if (atts[i] != NULL) + fprintf(stdout, "%s'", atts[i]); } } fprintf(stdout, ")\n");