Re:Parsing Child Nodes
XPath is an XLS extension supported by the default MS XML Parser that allows
scripting of an XML source.
That being said you can also try my freeware XML parser out as it gives you
fast easy access to the XML structure w/o a lot of overhead. Of course it
also doesn't have some of the nice features that other XML parsers have (XLS
Scripting support for example).
Download at:
eonclash.com/ViewProduct.php
In it you simply do:
XML.LoadFromFile('MyFile.xml');
XML.Root.NamedItem['SomeName'].SubItems[5].Count
Where NamedItem can walk down using "Name/Name" relations and SubItems gives
you indexed access to all sub nodes of any given node. Count of course
returns the count of the nodes that the parent contains.
- Jeremy
"Nirmal Singh" <
XXXX@XXXXX.COM>writes
Quote
On Thu, 08 Dec 2005 22:04:47 +0000, Peter Flynn <XXXX@XXXXX.COM>
writes:
>Assuming you have the sequence number of the desired Section element
>in the variable $n:
>
>The XPath expression "count(Section[position()=$n]/Line)" will return
>the number of Line elements in the $nth Section.
>
>The Boolean XPath expression "Section[position()=$n]/Summary" will
>evaluate to .true. if a Summary element is present.
>
Peter, what is XPath? I am using TXMLDocument with Delphi 7 professional.
Nirmal