XML & ASP Question

S

Stan Sainte-Rose

Hi Guys,
A simple question
I have a xml file
<lg>
<part name="myPart">
<subpart name="ab">ab</subpart>
<subpart name="cd">cd</subpart>
<subpart name="ef">ef</subpart>
</part>
</lg>

I need to read the name value of the part node.
I mean, how can I get : myPart ?

Thanks

Stan
 
E

Evertjan.

Stan Sainte-Rose wrote on 13 sep 2005 in
microsoft.public.inetserver.asp.general:
Hi Guys,
A simple question
I have a xml file
<lg>
<part name="myPart">
<subpart name="ab">ab</subpart>
<subpart name="cd">cd</subpart>
<subpart name="ef">ef</subpart>
</part>
</lg>

I need to read the name value of the part node.
I mean, how can I get : myPart ?

Off topic, where is the ASP?
 
B

Bob Barrows [MVP]

Stan said:
Hi Guys,
A simple question
I have a xml file
<lg>
<part name="myPart">
<subpart name="ab">ab</subpart>
<subpart name="cd">cd</subpart>
<subpart name="ef">ef</subpart>
</part>
</lg>

I need to read the name value of the part node.
I mean, how can I get : myPart ?

Thanks

Stan

<%
dim xmldoc
set xmldoc=createobject("msxml2.domdocument")
xmldoc.load "filename.xml"
dim oNode
set oNode=nothing
set oNode=xmldoc.selectSingleNode("//part")
if not isnothing(oNode) then
response.write oNode.getAttribute("name")
end if
%>

Bob Barrows
 
S

Stan Sainte-Rose

Bob Barrows said:
<%
dim xmldoc
set xmldoc=createobject("msxml2.domdocument")
xmldoc.load "filename.xml"
dim oNode
set oNode=nothing
set oNode=xmldoc.selectSingleNode("//part")
if not isnothing(oNode) then
response.write oNode.getAttribute("name")
end if
%>

Bob Barrows


Thanks :)

Stan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top