Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
XMLDOM navigation
Message
De
17/10/2007 14:26:44
Mike Sue-Ping
Cambridge, Ontario, Canada
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
XMLDOM navigation
Divers
Thread ID:
01261586
Message ID:
01261586
Vues:
65
I have the following XML:
<RootNode RootAttrib="0">
  <Child1Node>
    <C1Node C1Attrib="001">
      <RegionID ID="01">
        <Name>NE</Name>
      </RegionID>
      <RegionID ID="02">
        <Name>CE</Name>
      </RegionID>
      <RegionID ID="03">
        <Name>SE</Name>
      </RegionID>
    </C1Node>
    <C1Node C1Attrib="002">
      <RegionID ID="99">
        <Name>IN</Name>
      </RegionID>
    </C1Node>
    <C1Node C1Attrib="003">
      <RegionID ID="01">
        <Name>WE</Name>
      </RegionID>
      <RegionID ID="02">
        <Name>NO</Name>
      </RegionID>
      <RegionID ID="03">
        <Name>MW</Name>
      </RegionID>
      <RegionID ID="04">
        <Name>SO</Name>
      </RegionID>
    </C1Node>
  </Child1Node>
</RootNode>
If I get an object reference to the RootNode using XMLDOM, how can I drill down until I get to the RegionID node? I've tried recursively to use the hasChildnodes property but it is .T. at the RegionID level. I want to be able to recognize when there are no subsequent nodes like RegionID.

I don't know if I've described it correctly, but, I'd like to know when I'm at the second last node of the hierarchy? I've tried to compare a node's nextSibling nodename to the current node's nodename, but, that fails at CNode1 and I need to get to and stop at RegionID,

Mike
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform