Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XML
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 19th, 2007, 01:54 PM
Authorized User
 
Join Date: Jun 2004
Location: , , .
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default getting data from XML and insert it into a databas

Hi all, I have a customer list xml file that contains the folowing data:

<?xml version="1.0" ?>
<CustomerList>
 <Identification>
    <ID>1</ID>
    <Name>John </Name>
 </Identification>
<Order>
   <OrderNr>2</OrderNr>
   <customerNr>100</customerNr>
   <customerName>XXXX YYYYY</CustomerName>
</Order>
<Location>
  <ID>1</Location>
  <Place>NY</Place>
</Location>
<Identification>
    <ID>2</ID>
    <Name>David</Name>
 </Identification>
<Order>
   <OrderNr>3</OrderNr>
   <customernrNr>200</customerNr>
   <customerName>zzzzz vvvv</CustomerName>
</Order>
<Location>
  <ID>2</Location>
  <Place>NY</Place>
</Location>
<Identification>
    <ID>1</ID>
    <Name>John </Name>
</Identification>
<Order>
   <OrderNr>6</OrderNr>
   <customernrNr>300</customerNr>
   <customerName>KKKK LLLL</CustomerName>
</Order>
<Location>
  <ID>3</Location>
  <Place>AR</Place>
</Location>
</CustomerList>

I want to collect the ID value from Identification Node and OrderNr from Order Node and Insert them in a table (xmlTestTable) having ID and OrderNr as fields.

NB: ID from Identification and ID from Location are the same.
Can experts help me how to do it. Any sample code is apreciated. Thank you in advance



Reply With Quote
  #2 (permalink)  
Old November 19th, 2007, 02:29 PM
mhkay's Avatar
Wrox Author
Points: 18,481, Level: 59
Points: 18,481, Level: 59 Points: 18,481, Level: 59 Points: 18,481, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,960
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You haven't said what technology you are using.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Reply With Quote
  #3 (permalink)  
Old November 19th, 2007, 02:34 PM
Authorized User
 
Join Date: Jun 2004
Location: , , .
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi

Thank you for your reply
I am using asp.net, C#

belete

Reply With Quote
  #4 (permalink)  
Old November 20th, 2007, 12:38 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You need to load the XML into a class that can read it (XmlDocument, XmlTextReader) and then you can query or read, respectively the XML to get the data you want.

-Peter
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bulk insertion from a data table to oracle databas Alexkure ASP.NET 1.0 and 1.1 Professional 0 November 12th, 2008 03:24 AM
About Insert Multiple Rows of GridView to Databas divekar.vishal ASP.NET 2.0 Professional 0 April 30th, 2008 12:28 AM
append/insert data to xml file andhiez XML 5 April 18th, 2008 11:13 AM
How to insert bulk of data through form in databas ashuphp Beginning PHP 1 April 11th, 2007 07:36 AM
insert data param into xml from external file alexshiell XSLT 0 January 24th, 2006 01:47 PM



All times are GMT -4. The time now is 09:19 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.