On Jan 27, 2005, at 09:42, Eric Scheid wrote:


On 27/1/05 6:14 PM, "Henri Sivonen" <[EMAIL PROTECTED]> wrote:

try instead this example "I <3 Huckabees"...

That makes no difference, either.

<title type='TEXT>I &lt;3 Huckabees</title>
<title type='XHTML>I &lt;3 Huckabees</title>

Only type='HTML' is different.
<title type='HTML>I &lt;lt;3 Huckabees</title>

Doh. That should have been <title type='HTML>I &amp;lt;3 Huckabees</title>

is that right for XHTML?

Yes.

after XML decoding, the string data would be "I <3 Huckabees", which if
directly embedded into an XHTML <div> would be broken...

    <xhtml>
    <head></head>
    <body><div>I <3 Huckabees</div></body>
    </xhtml>

what am I missing?

You try to concatenate the parsed text node content string to a skeleton source string instead of moving the parsed text node to skeleton tree.


When <title type='XHTML>I &lt;3 Huckabees</title> is parsed, you get a 'title' element node with a text node child whose content is "I <3 Huckabees". To form an XHTML document, you don't concatenate that string to some source markup, but you move the text node to a tree like this (assume XHTML namespace):
html
head
body
div
#text: "I <3 Huckabees"


If this tree is now serialized, we get
<html xmlns='http://www.w3.org/1999/xhtml'><head/><body><div>I &lt;3 Huckabees</div></body></html>


--
Henri Sivonen
[EMAIL PROTECTED]
http://iki.fi/hsivonen/



Reply via email to