Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to selectsinglenodes with attribute value
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Divers
Thread ID:
00961280
Message ID:
00961549
Vues:
7
Terry,

I don't know...
But You can open XML file by XMLDOM without XSD. If you specify schema for XML and XML is not valid by XSD then Load() or LoadXML() return .F.
If You don't specify schema, then XMLDOM cannot select nodes by names or attributes (only xPath "*" or "*/* etc is functional).

MartinJ

>There were 2 XSDs. I removed them from the folder, but that was before I got this deep into the DOM. I forgot about those guys. Thanks!
>
>I'll move em back and do a few runs!
>
>Wouldn't DOM report an error or a parse error id a required XSD is not available?
>
>
>
>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform