Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Newbie question on processing XML file
Message
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Miscellaneous
Thread ID:
00854652
Message ID:
00855461
Views:
22
YOu can iterate through a collection that way, Jaime, but in many situations you really need to get the count also.

In the original problem in this thread, he's talking about a key-value relationship. It isn't clear whether he's selecting a single node for a single key or a collection and iterating through or what the purpose is.

Suppose he wants to verify the nature of the file, however. Often a web config file is editable by administrators and they'll edit XML any way they want -- in notepad, etc. Now you have the potential for multiple values against a single key.

When this condition exists, you can choose to error-notify, or you can decide to take the *last* member of the collection, similar to what happens with multiple key-pairs in CONFIG.FPW . Most people would do the latter.

By loading the file he's guaranteed well formed-ness and yes it possible to write an XSD is such a way that you can validate the uniqueness of the keys -- PITA to validate that way, maintain the XSD for this simple need, etc. Plus you can only error handle at that point, you can't choose to take the last value, as suggested above.

Easy to do a selectNodes by key and then check to see if .length = 1 <s>.

>L<
Previous
Reply
Map
View

Click here to load this message in the networking platform