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
diff --git a/ChangeLog b/ChangeLog
index d67cde6..cb8f7a4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Tue Oct 17 18:12:34 CEST 2006 Daniel Veillard <daniel@veillard.com>
+
+ * 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
+
Tue Oct 17 17:56:31 CEST 2006 Daniel Veillard <daniel@veillard.com>
* HTMLparser.c: fixing HTML entities in attributes parsing bug #362552
diff --git a/HTMLparser.c b/HTMLparser.c
index 590083c..5555766 100644
--- a/HTMLparser.c
+++ b/HTMLparser.c
@@ -3235,12 +3235,11 @@
NEXT;
SKIP_BLANKS;
val = htmlParseAttValue(ctxt);
- /******
- } else {
- * TODO : some attribute must have values, some may not
- if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
- ctxt->sax->warning(ctxt->userData,
- "No value for attribute %s\n", name); */
+ } else if (htmlIsBooleanAttr(name)) {
+ /*
+ * assume a minimized attribute
+ */
+ val = xmlStrdup(name);
}
*value = val;
diff --git a/result/HTML/doc2.htm.sax b/result/HTML/doc2.htm.sax
index 7cbbc51..f216ce3 100644
--- a/result/HTML/doc2.htm.sax
+++ b/result/HTML/doc2.htm.sax
@@ -38,12 +38,12 @@
SAX.endElement(meta)
SAX.endElement(head)
SAX.startElement(frameset, border='false', cols='172,*', frameborder='0', framespacing='0')
-SAX.startElement(frame, marginheight='0', marginwidth='0', name='left', noresize, scrolling='no', src='doc2_files/side.htm', target='rtop')
+SAX.startElement(frame, marginheight='0', marginwidth='0', name='left', noresize='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, scrolling='no', src='doc2_files/top.htm', target='rbottom')
+SAX.startElement(frame, marginheight='0', marginwidth='0', name='rtop', noresize='noresize', scrolling='no', src='doc2_files/top.htm', target='rbottom')
SAX.endElement(frame)
-SAX.startElement(frame, name='rbottom', noresize, src='doc2_files/contents.htm', target='_top')
+SAX.startElement(frame, name='rbottom', noresize='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 2cc38fa..7fda62c 100644
--- a/result/HTML/doc3.htm.sax
+++ b/result/HTML/doc3.htm.sax
Binary files differ
diff --git a/result/HTML/wired.html.sax b/result/HTML/wired.html.sax
index 3860c76..9d3e5f4 100644
--- a/result/HTML/wired.html.sax
+++ b/result/HTML/wired.html.sax
@@ -49,7 +49,7 @@
SAX.startElement(select, name='state')
SAX.characters(
, 2)
-SAX.startElement(option, value='WA', selected)
+SAX.startElement(option, value='WA', selected='selected')
SAX.characters(WA
, 4)
SAX.endElement(option)
@@ -442,7 +442,7 @@
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)
+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='selected')
SAX.characters(Wired News, 10)
SAX.endElement(option)
SAX.characters(