I've noticed some strange behavior I can't explain.
The following code fails in the nested <xpath> section (test #2) with the message »The element type "meta" must be terminated by the matching end-tag "</meta>".«.
<config><var-defname="source"><![CDATA[ <html> <head/> <body> <h1>Test</h1> </body> </html> ]]></var-def><!-- test #1 --><xpathexpression="/"><varname="source"/></xpath><!-- test #2 --><xpathexpression="/"><xpathexpression="/"><varname="source"/></xpath></xpath></config>
But there is no <meta> tag at all! And execution passes test #1 but fails test #2, although they are identical except for the nesting of another (actually the same) <xpath> evaluation.
However, the same code (with both test cases) is processed correctly if either the <head/> part is left out or the <html> tag is renamed to something else. So, these two versions work fine:
<config><var-defname="source"><![CDATA[ <html> <!-- no head here --> <body> <h1>Test</h1> </body> </html> ]]></var-def><!-- test #1 --><xpathexpression="/"><varname="source"/></xpath><!-- test #2 --><xpathexpression="/"><xpathexpression="/"><varname="source"/></xpath></xpath></config>
and
<config><var-defname="source"><![CDATA[ <foobar> <!-- root is not called html --> <head/> <body> <h1>Test</h1> </body> </foobar> ]]></var-def><!-- test #1 --><xpathexpression="/"><varname="source"/></xpath><!-- test #2 --><xpathexpression="/"><xpathexpression="/"><varname="source"/></xpath></xpath></config>
This behavior seems strange to me as there is obviously some HTML validation/correction involved, which I would have expected if I was using <html-to-xml> here, but I haven't. Actually, employing the <html-to-xml> processor on the source does not remedy the lack of a </meta> end-tag, either.
<config><var-defname="source"><!-- transform to valid XML --><html-to-xml><![CDATA[ <html> <head/> <body> <h1>Test</h1> </body> </html> ]]></html-to-xml></var-def><!-- test #1 --><xpathexpression="/"><varname="source"/></xpath><!-- test #2 --><xpathexpression="/"><xpathexpression="/"><varname="source"/></xpath></xpath></config>
Still getting the same error message »The element type "meta" must be terminated by the matching end-tag "</meta>".«.
Does anyone have a clue about this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've noticed some strange behavior I can't explain.
The following code fails in the nested
<xpath>
section (test #2) with the message »The element type "meta" must be terminated by the matching end-tag "</meta>".
«.But there is no
<meta>
tag at all! And execution passes test #1 but fails test #2, although they are identical except for the nesting of another (actually the same)<xpath>
evaluation.However, the same code (with both test cases) is processed correctly if either the
<head/>
part is left out or the<html>
tag is renamed to something else. So, these two versions work fine:and
This behavior seems strange to me as there is obviously some HTML validation/correction involved, which I would have expected if I was using
<html-to-xml>
here, but I haven't. Actually, employing the<html-to-xml>
processor on the source does not remedy the lack of a</meta>
end-tag, either.Still getting the same error message »
The element type "meta" must be terminated by the matching end-tag "</meta>".
«.Does anyone have a clue about this?