Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parsing XML with DOM
Message
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Environment versions
Visual FoxPro:
VFP 7
Miscellaneous
Thread ID:
00962465
Message ID:
00964781
Views:
12
loTitle=loNode.selectsingleNode("*[local-name()='title']")
Martin, I finally got a collection returned with this statement - and without adding a "schema" object.
oc=oXML.documentElement.childNodes(1).childNodes(0).selectNodes("*/*[local-name()='item']")
I will google MSXMLDOM and "local-name()" because your post was my first understanding of that "argument".

My XML has this for a schema location:
xsi:schemaLocation="http://www.imsglobal.org/xsd/imscp_v1p1 imscp_v1p1.xsd
                        http://www.adlnet.org/xsd/adlcp_v1p3 adlcp_v1p3.xsd
                        http://www.adlnet.org/xsd/adlseq_v1p3 adlseq_v1p3.xsd
                        http://www.imsglobal.org/xsd/imsss imsss_v1p0.xsd"  >
When I check for a namespaceURI:
?oXML.documentElement.namespaceURI
returns:
http://www.imsglobal.org/xsd/imscp_v1p1

It does that without an ADD schema - so I guess MS DOM is managing the schema "automatically". But I do need to validate that the XSDs in the "schemalocation" are included with the content.

One way to do that seems to be:
oSC = CreateObject("MSXML2.XMLSchemaCache.4.0")
oSC.add("http://www.adlnet.org/xsd/adlcp_v1p3","adlcp_v1p3.xsd")

Because, if the XSD is not local to the "folder" oSC.Add will return an error?

Is that the intended use? Is that how external schemas should be validated? Another way would be to parse out the XSD "filename and use VFP's FILE() command.

How should external schema (XSD's) that are in the location list be validated?
Imagination is more important than knowledge
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform