On 12/4/06, Lee <[EMAIL PROTECTED]> wrote:
Michael Van Canneyt wrote:
> On Sun, 3 Dec 2006, Lee wrote:

I've only used a couple of XML DOM/Libraries and each seems to work
differently than this although its probably just semantics.

fwiw,

i've done quite a bit of XML work over the years in Java for my day job.

any DOM implementation i've used in Java represents :

<foo>a value</foo>

as (2) nodes, <foo> being the parent of a "TEXT" node, and the text
node child being the node whose value is "a value".

a couple of other concepts that help to clarify why the DOM works this way :

<foo>a value<foo2>has another value</foo2></foo>.

"a value", the text node, and <foo2> are both child nodes of <foo>.

(forgive me, i always forget CDATA syntax ...)

<foo><!CDATA[a value]]/></foo>

... is structurally equivalent to ...

<foo>a value</foo>

this is very convenient from an API perspective, as the programmer
typically doesn't care about the "type" of the node holding the text
and it's behavior, you just want the text value, and again, it's
convenient that you don't have to worry about whether it is a "plain
text" node, or a "cdata" node.

if you _needed_ to know, you can interrogate the node for its type.

For instance, with .net, I would access that value (123) with Node.InnerText.

my $0.02 ...

try to avoid learning how standards based mechanisms work by using MS
API's as your reference implementation.

:)


Lee

Tony

--
X-SA user ? 0.5.1 is out !
XData 0.1 for X-SA is out !
http://x-plane.dsrts.com

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to