RE: [xml] possible bug?



It seems that a problem arises when both html and head nodes have to be
implicitly created and then the head tag is closed. Therefore this won't
work:


I think I've found the root of the problem. The parser is recursive -
htmlParseContent is called recursively via htmlParseElement. Therefore for a
normal case this is what happens:

[call htmlParseDocument]
[call htmlParseContent] : 1
<html> [call htmlParseContent] : 2
  <head> [call htmlParseContent] : 3
    <title> [call htmlParseContent] : 4
    </title> [exit htmlParseContent] : 3
  </head> [exit htmlParseContent] : 2
  <body> [call htmlParseContent] : 3
    <h1> [call htmlParseContent] : 4
    </h1> [exit htmlParseContent] : 3
  </body> [exit htmlParseContent] : 2
</html> [exit htmlParseContent] : 1
[exit htmlParseContent] : 0
[exit htmlParseDocument] - Finish

But now a problem arises when nodes are implicitly defined.

[call htmlParseDocument]
[call htmlParseContent] : 1
<title> [implicitly define html and head nodes and then call
htmlParseContent] : 2
</title> [exit htmlParseContent] : 1
</head> [exit htmlParseContent] : 0
[exit htmlParseDocument] - Finish

Because we have come back to the topmost level, parsing simply stops,
regardless.

Well, this is what I think is going on, at the moment I don't really know
how this should be fixed. Perhaps htmlParseContent can be passed a flag that
tells it to do nothing but recurse when implicitly defining tags.

Daniel - Can you verify this?

Prash


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]