Dilip wrote:
Just so that I got this straight, from the standpoint of the XML parser
does the 2 forms of elements make a difference? I mean, if I use XPath
to locate that element to retrieve its value, will I get back IBM or
something else?
XPath doesn't distinguish the two; both yield IBM.
Parsers *CAN* distinguish the two, for the convenience of editors and
other tools which want to be able to display syntax as well as semantics
-- but aren't required to and often don't unless you ask them to.
probably just treats whatever is inside as plain text, right?)
Modulo the difference in how escaping is handled, yes, pretty much. A
SAX parser may tell the application that it's now inside the bounds of a
CDATA section; the app needs to decide whether to listen for lexical
events and whether it cares about this one. A DOM (depending on how the
builder is configured) may display the data using a CDATASection Node
rather than a Text Node, but the former is a subclass of the latter so
again that doesn't matter unless the application cares about the difference.
As far as the XML Infoset is concerned, <![CDATA[&a<]]is just a
representation of the character sequence &a< and is identical to
&a< or &a< or &a< or any of the other possible
combinations. The Infoset considers the differences between these to be
No Difference.
--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden