473,480 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Help--XML file

Hi NG
i have the following problem:
In this file xml i want to extract the attribuite url situated in the
node mather. in ather word i want to put the contet of url, in this
case "http://google.com", in a string variable.
Now what do you suggest? i know i have to use the package System.Xml
(in c#) but i don't find the method that allow me to extract this
information from this node!
thanks in advance
Carmine
<?xml version="1.0" encoding="ISO8859-1" ?>
- <Pentheus>
- <occupation>
<king>Thebe from 1954 to 2000</king>
<prince>Danimark from 1940 to 1954</prince>
<jester>during the reign of TEST</jester>
<Test>from 123 to 1234</Test>
</occupation>
<Mother url="http://google.com">Agave</Mother>--HERE-------------HERE---
<url>prova123</url>
<Father>Echion</Father>
prova
- <food>
<name>French Toast</name>
<price>$4.50</price>
<description>thick slices made from our homemade sourdough
bread</description>
<calories>600</calories>
</food>
- <dog>
<name>Attanasius</name>
<race>crossbreed</race>
<description>wonderfull dog</description>
<size>950</size>
</dog>
</Pentheus>
Nov 15 '05 #1
1 1118
Hi Carmine,

"Carmine" <bl******@katamail.com> wrote in message
news:bc**************************@posting.google.c om...
Hi NG
i have the following problem:
In this file xml i want to extract the attribuite url situated in the
node mather. in ather word i want to put the contet of url, in this
case "http://google.com", in a string variable.


Have a look at System.Xml.XmlDocument.SelectSingleNode()

One possible XPath expression for this might be /Pentheus/Mother/@url
but it can of course be more general.
See http://www.w3.org/TR/xpath#path-abbrev for some XPath samples.
If there's a match in the instance you'll get back a node of type
Xml.Attribute and its Value property is the string you want.

Regards,

-djm
Nov 15 '05 #2

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

Similar topics

2
3908
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo gallery. An upload form, to upload the photos and give...
5
5426
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. ...
18
9063
by: Dino | last post by:
dear all, i've created an application for a customer where the customer can upload ..csv-files into a specified ftp-directory. on the server, a php-script, triggered by a cronjob, reads all the...
0
8222
by: chris | last post by:
I'm writing a small app to help me learn more about cryptography. All it does is encrypt all of the files in directory A, and put the encrypted versions of the files in directory B. It then...
5
10122
by: simon place | last post by:
is the code below meant to produce rubbish?, i had expected an exception. f=file('readme.txt','w') f.write(' ') f.read() ( PythonWin 2.3 (#46, Jul 29 2003, 18:54:32) on win32. ) I got...
7
3512
by: Joseph | last post by:
Hi, I'm having bit of questions on recursive pointer. I have following code that supports upto 8K files but when i do a file like 12K i get a segment fault. I Know it is in this line of code. ...
3
26234
by: StGo | last post by:
How can i read/write file's custom attributs(like subject,author...) in C#??? Thanks :))
0
3903
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
6
2616
by: martin | last post by:
Hi, I have noticed that every aspx page that I created (and ascx file) has an assosiated resource file aspx.resx. However what I would like to do is have a single global resource file for the...
13
4280
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming...
0
7037
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
7076
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...
1
6732
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...
0
5324
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,...
1
4768
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...
0
4472
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2990
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2976
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
174
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.