473,385 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

XML & ASP Question

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
Sep 13 '05 #1
3 1220
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?
--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Sep 13 '05 #2
Stan Sainte-Rose wrote:
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
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Sep 13 '05 #3

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> a écrit dans le message de
news: u4**************@TK2MSFTNGP14.phx.gbl...
Stan Sainte-Rose wrote:
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

Thanks :-)

Stan
Sep 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ajm | last post by:
hi, a simple question perhaps...I am parsing an XML document with expat (1.95.x) which has content like: <element>text &amp; more text E</element> from which expat outputs something along the...
12
by: Sammy | last post by:
Hi, my mind is going crazy. I have tried everything I can think of to no avail. I have tried Disable Output Escaping. I tried to think of a way of enclosing the attribute data in a CDATA...
11
by: BoonHead, The Lost Philosopher | last post by:
I think the .NET framework is great! It's nice, clean and logical; in contradiction to the old Microsoft. It only saddens me that the new Microsoft still doesn't under stand there own...
27
by: Daniel Vallstrom | last post by:
I'm having problems with inconsistent floating point behavior resulting in e.g. assert( x > 0.0 && putchar('\n') && x == 0.0 ); holding. (Actually, my problem is the dual one where I get...
20
by: William | last post by:
Original question: "Give a one-line C expression to test whether a number is a power of 2. " Answer: if (x && !(x & (x-1)) == 0) My question: Why does this expression work?
11
by: Jeremy | last post by:
How can one stop a browser from converting &amp; to & ? We have a textarea in our system wehre a user can type in some html code and have it saved to the database. When the data is retireved...
6
by: cj | last post by:
I'm receiving an xml formatted string that I pull data from by reading it into an xml document like this: Dim doc As New Xml.XmlDocument doc.LoadXml(respstr) Dim co_name As Xml.XmlNodeList =...
14
by: Arne | last post by:
A lot of Firefox users I know, says they have problems with validation where the ampersand sign has to be written as &amp; to be valid. I don't have Firefox my self and don't wont to install it only...
0
by: Vijay | last post by:
Prep Courses for International Certifications, CSTE & CSQA & ISEB & ISTQB &Business Analyst & SOA Certifications in HYDERABAD. After receiving overwhelming response to our last 50+ batches, ...
3
by: Nathan Sokalski | last post by:
I am adding an onmouseover attribute using the Attributes.Add() method, and the String I am using for the value contains the & character. However, when rendered the & is converted to the HTML...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.