"Pim75" <p.******@tisca li.nlwrote in message
news:11******** **************@ k70g2000cwa.goo glegroups.com.. .
>>>>
Hello,
I have to read a XML file in ASP and save the values in a database. I
can get this work, but I cannot read some nested nodes of the xml file.
This is a part of the XML file:
<Interface>
<Product>
<CategoryFeatur eGroup ID="622" No="1">
<FeatureGroup ID="0">
<Name ID="5073" Value="Technica l details" langid="1" />
<Name ID="5074" Value="Technisc he details" langid="2" />
<Name ID="8345" Value="Détails techniques" langid="3" />
<Name ID="16114" Value="Technisc he Details" langid="4" />
<Name ID="20246" Value="Technica l details" langid="5" />
<Name ID="24378" Value="Technica l details" langid="6" />
</FeatureGroup>
</CategoryFeature Group>
<CategoryFeatur eGroup ID="42" No="60">
<FeatureGroup ID="3">
<Name ID="4863" Value="Memory" langid="1" />
<Name ID="4864" Value="Geheugen " langid="2" />
<Name ID="7176" Value="Mémoire vive" langid="3" />
<Name ID="16018" Value="Speicher " langid="4" />
<Name ID="20150" Value="Memory" langid="5" />
<Name ID="24282" Value="Memory" langid="6" />
</FeatureGroup>
</CategoryFeature Group>
</Product>
</Interface>
I read the node <CategoryFeatur eGroupwith the following code:
Set rootNode = xmlDoc.selectSi ngleNode("Inter face/Product")
For Each Node in rootNode.select Nodes("Category FeatureGroup")
Waarde(n) =
xmlDoc.getEleme ntsByTagName("C ategoryFeatureG roup").item(n). getAttribute("I D
")
n=n+1
Next
Now I also have to read the values from <FeatureGroupan d the <Name>
elements within every <CategoryFeatur eGroup>. Can someone tell me how
to do this within the ASP code above?
Thanks for any help!
Nick
<<<<
You select each CategroyFeature Group into a Node variable but then don't use
the variable.
For Each Node in rootNode.select Nodes("Category FeatureGroup")
Waarde(n) = node.getAttribu te("ID")
n=n+1
Next
Why is this data ending up in an array?
Where do you want to put the other data?
It seems to me you want to build a whole bunch of arrays of variables to
then update a DB. Which Database are you using?
A good solution would avoid loading up a set of variables and arrays but
simply take the content of the XML more directly to the DB.
Anthony