Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parsing XML with DOM
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Versions des environnements
Visual FoxPro:
VFP 7
Divers
Thread ID:
00962465
Message ID:
00964411
Vues:
12
Hi Don,

selectNodes() - Return values:
Object. Returns a collection of nodes selected by an XSL Pattern or XPath query. If no nodes are selected, an empty collection is returned.
FOR lii=0 to loProgram.length-1
    loNode=loProgram.item(lii) && Get program element

    ?loNode.xml
    loTitle=loNode.selectsingleNode("*[local-name()='title']")
    ?loTitle.xml
    ?loTitle.text
NEXT
MartinJ

>Well Martin, I truly thought we had this finished but now there is another problem. I cannot seem to get at the child nodes of the elements. If
>
>loPrograms = loXML.documentElement.selectNodes("*/*/*/*/*/*[local-name()='programs']/*[local-name()='program']")
>oProgram = loPrograms.nextNode
>? oProgram.xml
>? oProgram.firstChild.nodeName
>? oProgram.childNodes(0).text &&
>
>produces
>
><program xmlns="urn:TMSWebServices" id="EP1305240021">
>        <title>The Crocodile Hunter</title>
>        <subtitle>Where Devils Run Wild</subtitle>
>        <description>Steve and Terri seek the Tasmanian tiger, thought to be extinct since the
>	1930s; Tasmanian devils; copperhead snakes; black-face shaggs; Paddy Mellon joeys;
>	wombats.</description>
>        <showType>Series</showType>
>        <series>SH130524</series>
>        <originalAirDate>1998-06-22</originalAirDate>
></program>
>title
>The Crocodile Hunter
>
>but
>
>? oProgram.selectSingleNode("title").text
>
>produces an error
>
>"Member SELECTSINGLENODE does not evaluate to an object."
>
>how do you extract a specific node such as "title?" I have tried every combination of the various calls that I can think of and none seem to work. The problem code worked fine in my sample data but errors out when applied to the full file.
>
>What gives?
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform