Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parsing XML with DOM
Message
 
To
23/11/2004 20:38:12
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Environment versions
Visual FoxPro:
VFP 7
Miscellaneous
Thread ID:
00962465
Message ID:
00964363
Views:
9
Hi Don,

>Thank you Martin. This does the job nicely. Can you explain the meaning of the content of the line:
>
>loxx=loxml.documentElement.selectNodes("*/*/*/*/*/*[local-name( ='schedules']/*[local-name()='schedule']")
>
>What does the "local-name()=" refer to? I know you said it was equivalent to the other syntax but the other form is easier to read. Alas I was not able to get the other form to work. (Maybe I missed one of the levels.)

local-name() is XPath function
Returns the local part of the expanded name of the node in the node-set argument that is first in document order.

* - is none or more elements (Wildcard; selects all elements regardless of the element name.)
  1 2 3 4 5 6                           7
  */*/*/*/*/*[local-name() ='schedules']/*[local-name()='schedule'
1 +SOAP-ENV:Body
2  +ns1:downloadResponse
3   +xtvdResponse
4    +xtvdDocument
5     +xtvd
6      +schedules
7        schedule
>
>Also, what do these 2 lines do?
>
>loXML.async=.f.
(from MSDN)
Boolean. The property is read/write. Returns True if asynchronous download is permitted; False if not. Default is True.

When set to True, the load method returns control to the caller before the download is finished. You can then use the readyState property to check the status of the download. You can also attach an onreadystatechange handler or connect to the onreadystatechange event to be notified when the ready state changes so that you know when the download is complete.

This member is an extension of the Worldwide Web Consortium (W3C) Document Object Model (DOM).


>loXML.SetProperty("SelectionLanguage","XPath")
(from MSDN)
SelectionLanguage internal property (flag)

"XPath" or "XSLPattern"
The SelectionLanguage property defaults to "XSLPattern". This property indicates the type of query the user plans to pass into selectNodes or selectSingleNode. "XSLPattern" is the default for backward compatibility. This flag applies to all nodes whose ownerDocument property points to this document object. Therefore, if a given node is moved to a different document, its selectNode behavior may change depending on the SelectionLanguage setting in the new document. The following Jscript example on the client shows how to set the SelectionLanguage to XPath for the xmldoc object.

MartinJ

>
>Thanks again.
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Previous
Reply
Map
View

Click here to load this message in the networking platform