Perhaps I'm missing something -- I don't know that much about JS and less about 
Ajax -- but these error messages look like they're exactly right to me. In the 
first case, you're starting element foo, then element bar, then ending element 
foo before you end the child element bar. That's ill-formed XML, and one way of 
describing that is as an "XML tag name mismatch." In the second case, you've 
got a start element tag but no end element tag, so the XML parser would reach 
the end of the evaluated document without the close to element foo and you'd 
get exactly what you did get -- "unexpected end of XML source."

I wonder about what Frank wrote -- his example would have been well-formed XML, 
but its root element was html, so it wouldn't have been valid in the place in 
the document where it was being evaluated because the DTD for HTML and/or XHTML 
only allows a single html root element, not a child html element under that. 
I'm not sure if eval is supposed to be producing an entire page of html 
separate from the surrounding document, but it doesn't look that way since you 
can also eval fragments and code which doesn't include any tags at all. If 
you're not supposed to be evaluating an entirely separate page, I would guess 
that you would need to eval the code which needs to appear in the head section 
of the document and the code which needs to appear in the body separately.

Not sure if that makes sense -- still waking up this morning. Hope it helps.

Chris

-----Original Message-----
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 29, 2006 7:49 AM
To: Struts Users Mailing List
Subject: RE: Struts, AJAX, JSP, and JavaScript question

From: Frank W. Zammetti [mailto:[EMAIL PROTECTED]
> (interestingly, in IE I get a syntax error, because it's trying to 
> interpret the markup as script, but in FF it just quietly doesn't 
> work, not even a notice in Firebug).

Something else interesting in FF:

eval("<foo><bar></foo></bar>")

"XML tag name mismatch"

eval("<foo>")

"unexpected end of XML source"

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to