473,657 Members | 2,497 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Extract XML FILE Contents using NODE NAME

126 New Member
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
3 2272
nukefusion
221 Recognized Expert New Member
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 New Member
@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 Recognized Expert Specialist
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
1532
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
1630
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
23108
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> <email>ma@xe.net</email>
6
4627
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(); listView1.Items.Add (myString); } Is there a way I can fill up the second column this easily? Thw way I'm currently doing it is using the subitems property to add it. Unfortunately,
1
2251
by: Miki Peric | last post by:
Which .Net function I should use to extract file name from URL/path?
2
1764
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 extract all the attributes, so that I can register the namespaces. The document looks like: <?xml version="1.0" encoding="UTF-8" ?> <ConfigDataFile xmlns:SRI="SRI" xmlns:SIW="SIW" xmlns:QBQ="QBQ" xmlns:VLD="VLD"...
1
3144
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 |consumerid|status1|status2|meter no1|meter no2|nameof consumer|routeno 234133210003040002222222222000003333333123098sasdcscasdsadsd9041 231433104000267232222278222000003333333123098shskdfkscasdsade9012 this is the format of text file.there are thosands of records in this...
6
1240
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
1783
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 elliminate this I have used encoding along with above method System.IO.File.ReadAllText(strFile, System.Text.Encoding.ASCII) But still it is not working.Can anybody have the solution for this
1
3670
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> <MapRule input="@PARENT()" output="Sales_Totals" /> <MapRule input="''" output="Sales_Totals@name" /> <MapRule input="''" output="Sales_Totals@type" /> <MapRule input="" output="Sales_Totals@allTimeSales" />
0
8392
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8305
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
8726
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
8503
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
8603
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
7320
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...
0
5632
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
1944
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1604
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.