Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to selectsinglenodes with attribute value
Message
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Miscellaneous
Thread ID:
00961280
Message ID:
00961485
Views:
6
Huh Terry,

I'm blind...

Base Source code for MS XMLDOM, XML a XSD on local disc, but I don't know how use it for www.
sc=createobject("MSXML2.XMLSchemaCache.4.0")
sc.Add("http://www.adlnet.org/xsd/adlcp_v1p3", "your_xsd_file.xsd")

doc=CREATEOBJECT("MSXML2.DOMDocument.4.0")
doc.schemas = sc
doc.async = .F.
doc.setProperty("SelectionNamespaces", [xmlns:cvp="http://www.adlnet.org/xsd/adlcp_v1p3"])
?doc.Load("your_xml_file.xml")

* Select all nodes resource with attribute href
loXX=m.loXML.documentElement.selectNodes('*/resource[@href]')

* Select all nodes resource with attribute href=intro.htm
loXX=m.loXML.documentElement.selectNodes('*/resource[@href="intro.htm"]')

* Select all nodes resource with attribute adlcp:scormType (may be)
loXX=m.loXML.documentElement.selectNodes('*/resource[@adlcp:scormType]')
MartinJ

>>Hi Terry,
>>
>>Can you paste valid XML (part)?
>>
>>MartinJ
>
>it's big (sorry michele:)
>the "resources" node is oXML.documentelement.childnodes(2)
>
>
><?xml version="1.0" standalone="no" ?>
><manifest identifier="photo-MANIFEST-none" version="1.3"
>    xmlns="http://www.imsglobal.org/xsd/imscp_v1p1"
>    xmlns:adlcp="http://www.adlnet.org/xsd/adlcp_v1p3"
>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>    xsi:schemaLocation="http://www.imsglobal.org/xsd/imscp_v1p1 imscp_v1p1.xsd
>                        http://www.adlnet.org/xsd/adlcp_v1p3 adlcp_v1p3.xsd">
>...
></manifest>
>
"Navision is evil that needs to be erazed... to the ground"

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

Click here to load this message in the networking platform