473,803 Members | 3,725 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1231
Stan Sainte-Rose wrote on 13 sep 2005 in
microsoft.publi c.inetserver.as p.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=createob ject("msxml2.do mdocument")
xmldoc.load "filename.x ml"
dim oNode
set oNode=nothing
set oNode=xmldoc.se lectSingleNode( "//part")
if not isnothing(oNode ) then
response.write oNode.getAttrib ute("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******@NOyah oo.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=createob ject("msxml2.do mdocument")
xmldoc.load "filename.x ml"
dim oNode
set oNode=nothing
set oNode=xmldoc.se lectSingleNode( "//part")
if not isnothing(oNode ) then
response.write oNode.getAttrib ute("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
1674
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 lines of <element>text & more text A</element>
12
9478
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 element. That did not parse. Here is my question: How can I get attribute values to not get converted from &apos; to '
11
3658
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 rules when it comes to file paths. A lot of Microsoft installers for example, and also installers of other companies, do not work because they handle paths in the following manner:
27
3863
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 failed assertions for assertions that at first thought ought to hold, but that's not important.) At the end is a full program containing the above seemingly
20
11385
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
6446
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 and
6
2251
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 = doc.GetElementsByTagName("co_name") textbox1.text = co_name(0).innertext Now I'm getting company names that have ampersands in them. I was not aware that was not allowed in xml and had no method of dealing with it.
14
5938
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 because of this, so I hope some of you gurus can enlighten me with this :) In what circumstances can the "&amp;" in the source code be involuntary changed to "&" by a browser when or other software, when editing and uploading the file to the web...
0
6749
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, SPECTRAMIND SOLUTIONS now announces a new batch of Prep Courses for CSQA & CSTE& ISEB & ISTQB & Business Analyst & SOA so as to prepare you thoroughly for the most prestigious certification exams conducted by International organizations. We...
3
3238
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 representation of &amp; which causes my JavaScript not to work. What can I do to prevent the Add() method from modifying my value? Thanks. -- Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/
0
9566
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10555
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10317
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10300
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10069
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9127
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7607
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4277
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.