php - Why are warning messages generated about duplicate IDs when there are none? -
The following is an unexpected warning message that the server is giving me:
Warning: DOMDocument :: Load HTML () [domdocument.loadhtml]: ID Page 3 is already defined in the unit, Line: 25C in: \ Program Files \ Zend \ Apache 2 \ htdocs \ joom \ templates \ valueTemplate \ updateRecord.php Row At 74 .
The above warning message is generated on the execution of the following code:
$ html = new DOMDocument (); $ HTML- & gt; Load HTML ($ Factaid ['Content']);
.
The message is unpredictable because there is no duplicate usage of 'page3' in the HTML document as an id. I 'Page 3', however, the HTML document is used as the value of the name attribute multiple times is. For example:
& lt; Li id = "index00025" name = "page3" class = "fooBar" & gt; & Lt; / Li & gt;
.
Any help on this will be fully appreciated. thank you in advanced.
This is expected behavior in HTML, the attribute "name" introduces an ID, such as attribute "Id" is, if element is a
(I do not know anything about limbxmal internal, so I do not know what condition elem
can be zero.)
/ ** * xmlIsID: * [...] * * Determine that there is a feature type id if we have DTD (S) * it is done if DTD Requested loading. In the case of HTML documents written with HTML parser, ID detection is done * systematically * [...] * / int xmlIsID (xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr) {[...]} and If (Doctor-> type == XML_HTML_DOCUMENT_NODE) {if ((xmlStrEqual (BAD_CAST "id", Attr- & gt; name)) || ((xmlStrEqual (BAD_CAST "name", atri-> Name )) & Amp; amp; amp; ((elem == NULL) || (xmlSteEqual (elem-> Names, BAD_CAST) a ")))))) Return (1); Return (0);} [.. .]}
source: valid.
libxml distribution.
Comments
Post a Comment