[fpc-pascal] another xml question
Chris Moody
inquiry at greensnakedesign.com
Thu Aug 6 10:11:59 CEST 2015
Hi Marc,
Thanks for the feedback. One more question and I think I'm done for now
and able to finish the program I'm writing:
If FindNode does not locate a node with the given name, what does it
return?
Thanks,
Chris
On 07/24/2015 01:34 PM, Marc Santhoff wrote:
> On Fr, 2015-07-24 at 11:57 -0700, Chris Moody wrote:
>
>> Would it be easiest to introduce a fourth element to the XML that says
>> how many children the 3rd element has? Or is there an easy way already
>> to get this and just run a for next loop to read each child?
> Maybe sth. like this would do:
>
> <counted_element count=3>
> <child>1>/child>
> <child>2>/child>
> <child>3>/child>
> </counted_element>
>
> or similar. Besides making the count an attribute of the root node of
> counted elements you could simply use a standard pascal loop:
>
> n: XMLNode;
>
> { this is only pseude code ... }
> while (xmldoc.hasMoreChilds()) do begin
> n := getChild();
> ... process n ...
> end:
>
> For real code http://wiki.freepascal.org/XML_Tutorial mwill help.
>
> HTH,
> Marc
>
More information about the fpc-pascal
mailing list