Re: Editing XML
- From: Hans-Peter Diettrich <DrDiettrich1@xxxxxxx>
- Date: Tue, 12 Jun 2007 02:54:29 +0200
Maarten Wiltink wrote:
Does here "@" refer to (all?) attributes, "*" to all childnodes, and
text() to the text? The members of the elements (or nodes?) still are
somewhat unclear to me :-(
* is short for all nested elements, @* for all nested attributes,
text() for all nested text nodes, node() for all nested nodes. A
few other node types such as processing instructions and comments
are dutifully ignored in the above code.
I wonder how text and child nodes are distinguished in the XML text. Or can a element have either text or child nodes, but not both at the same time?
You may want to read the XSLT and XPath specs from W3C. It's a long
read, but well worth it - at least I thought so. Be warned that I
also thought Christopher Tolkien's editions of his father's mislaid
writing worth it. There is a certain similarity; both are not to
everyone's taste.
Right, I only was not sure which exact syntax is used by which tool. I suspect that MS does not respect "foreign" standards much, as usual...
Also I didn't understand the difference between XMLDoc.DocumentElement,
.Node and .ChildNodes. Is .Node the very root node of the document,
whose children are the .ChildNodes, and .DocumentElement is one of these
children? There also seems to exist a flat list of all elements or nodes
in a document?
No, .DocumentElement is the document's root node. .Node is probably
a more volatile 'current node' thing, more useful from other node types
than documents.
There must exist a difference. When I start walking through the children of .Node, I get 3 xml nodes, but only 2 when starting with ..DocumentElement. The last of these nodes seems to be the /xml tag, so I have no idea yet, what the Delphi classes or the MS interface understand as "node", "element" and so on :-(
The discussion is muddied by several things running together.
Right :-(
DoDi
.
- Follow-Ups:
- Re: Editing XML
- From: Rob Kennedy
- Re: Editing XML
- References:
- Editing XML
- From: Hans-Peter Diettrich
- Re: Editing XML
- From: Rob Kennedy
- Re: Editing XML
- From: Hans-Peter Diettrich
- Re: Editing XML
- From: Rob Kennedy
- Re: Editing XML
- From: Rob Kennedy
- Re: Editing XML
- From: Hans-Peter Diettrich
- Re: Editing XML
- From: Maarten Wiltink
- Re: Editing XML
- From: Hans-Peter Diettrich
- Re: Editing XML
- From: Maarten Wiltink
- Editing XML
- Prev by Date: Re: Set the CheckBox.Checked without the OnClick being called
- Next by Date: Re: Editing XML
- Previous by thread: Re: Editing XML
- Next by thread: Re: Editing XML
- Index(es):