473,396 Members | 1,982 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,396 software developers and data experts.

Extract XML FILE Contents using NODE NAME

126 100+
I have been asked to extract data from XML File using NODE NAME. I am new to XML and I do not know how to identify or understand what is NODE NAME.

This is the XML File content, Please show me what is NODE NAME and Data. Thank You.

Expand|Select|Wrap|Line Numbers
  1. ]<?xml version="1.0" encoding="utf-8"?>
  2. <!--File Exported on 21/05/2010 12:26:48 p.m.-->
  3. <table>
  4.  <row>
  5.                 <CustomerID>CHOPS</CustomerID>
  6.                 <CompanyName>Chop-suey Chinese</CompanyName>
  7.              <OrdDate>01/03/2010</OrdDate>
  8.     <ReqDate>02/03/2010</ReqDate>
  9.     <ShipDate>03/03/2010</ShipDate>
  10.     <TransFee>7555.55</TransFee>
  11. </row>
  12. <row>
  13.     <CustomerID>CHOPS</CustomerID>
  14.     <CompanyName>Chop-suey Chinese</CompanyName>
  15.     <OrdDate>03/03/2010</OrdDate>
  16.     <ReqDate>04/03/2010</ReqDate>
  17.     <ShipDate>05/03/2010</ShipDate>
  18.     <TransFee>123.45</TransFee>
  19. </row>
  20. <row>
  21.     <CustomerID>CHOPS</CustomerID>
  22.     <CompanyName>Chop-suey Chinese</CompanyName>
  23.     <OrdDate>03/03/2010</OrdDate>
  24.     <ReqDate>04/03/2010</ReqDate>
  25.     <ShipDate>05/03/2010</ShipDate>
  26.     <TransFee>987.65</TransFee>
  27. </row>
  28.  
  29. </table>
May 21 '10 #1

✓ answered by nukefusion

Hi,
The XML file is comprised of nodes, in your case a table node, a row node, CustomerID node, etc, etc.

These are quite simply the names of the nodes.

The data is the bit that comes between the opening and closing tags. For example, your first CustomerID tag has:

An opening tag: <CustomerID>
Data: CHOPS
a closing tag: </CustomerID>

To extract this data you could use something called XPath.

A great place to start learning about these technologies is W3Schools.

XML
XPath

Good luck, I hope this helps.

3 2260
nukefusion
221 Expert 100+
Hi,
The XML file is comprised of nodes, in your case a table node, a row node, CustomerID node, etc, etc.

These are quite simply the names of the nodes.

The data is the bit that comes between the opening and closing tags. For example, your first CustomerID tag has:

An opening tag: <CustomerID>
Data: CHOPS
a closing tag: </CustomerID>

To extract this data you could use something called XPath.

A great place to start learning about these technologies is W3Schools.

XML
XPath

Good luck, I hope this helps.
May 21 '10 #2
lenniekuah
126 100+
@nukefusion
Hi Nukefuson,
thank you very much for the information. You are awesome and generous in sharing information.

Have a Good Day,
Cheers,
Lennie
May 22 '10 #3
Curtis Rutland
3,256 Expert 2GB
I would also suggest looking up the tools in the System.Xml.Linq namespace. They are, to me, much easier to use for querying into XML if you are unfamiliar with XPath or the DOM.

Here's a good place to start.
May 28 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: MVB | last post by:
Hi Does Anyone know how to read the file contents using the Windows API BackupRead()?? Please do reply MVB
2
by: blip | last post by:
Is this acceptable ? It seems too easy and too simple... #include<iostream> #include<fstream> #include<cstdlib> #include<string> struct Person{ char name ; int age ;
3
by: zerdust | last post by:
how can I change the name of XML node? this is sample <?xml version="1.0"?> <adresboek> <adres> <naam>Mark van Renswoude</naam> <straat>ddden 24</straat> <plaats>Scddd</plaats>...
6
by: VM | last post by:
How can I fill up a listview with text file contents? My listview has two columns and the first column fills up with a while loop: while (myString != null) { myString = sr.Readline();...
1
by: Miki Peric | last post by:
Which .Net function I should use to extract file name from URL/path?
2
by: RichardHatcher.com | last post by:
I am writing C code using xpath to extract some data from a XML document. The file uses namespaces, but the name spaces are all listed in the root node of the file as attributes. I want to...
1
by: sachin10 | last post by:
hi i m sachin, i m new to VB programming.i face some problem regarding the sorting of text file contents using arrays.text file have data in the format as below seq...
6
by: nnamakaonwodi | last post by:
I have a file that I want to read. The structure is given in C++ eg. typedef HEADER_TAG { UCHAR index; UCHAR crt; }HEADER_TAG
2
by: amollokhande1 | last post by:
Hi, I am trying to read the file contents using System.IO.File.ReadAllText After reading the file contents the special charaters (á) gets replaced with some garbage characters like "?". To...
1
by: SWETA123 | last post by:
I will very helpful to you if you can help me out in my below problem. I am not getting idea what should be the right approach for this. Here is my problem. I have below (sample)xml. <Rules>...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
0
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
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...

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.