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

mapping the data xml with fields the database

132 100+
hi,

i have this file XML
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  4. <authentication login="MyLog" password="MyPass" />
  5. <inventoryUpdate hotelId="4">
  6. <room id="B3T">
  7. <inventory>
  8. <availability from="2010-12-28" to="2010-12-28" quantity="1" />
  9. <availability from="2010-12-29" to="2010-12-31" quantity="1" />
  10. <availability from="2011-01-01" to="2011-01-01" quantity="1" />
  11. <availability from="2011-01-02" to="2011-03-31" quantity="1" />
  12. <availability from="2011-04-01" to="2011-12-30" quantity="1" />
  13. </inventory>
  14. <rate currency="EUR" rateCode="BAR" rateName="Best Available Rate">
  15. <planning from="2010-12-28" to="2010-12-28" minimumStay="1" unitPrice="210"
  16. noArrival="false" isClosed="false" />
  17. <planning from="2010-12-29" to="2010-12-31" minimumStay="1" unitPrice="273"
  18. noArrival="false" isClosed="false" />
  19. <planning from="2011-01-01" to="2011-01-01" minimumStay="1"
  20. unitPrice="340.0000" noArrival="false" isClosed="false" />
  21. <planning from="2011-01-02" to="2011-03-31" minimumStay="1" unitPrice="294"
  22. noArrival="false" isClosed="false" />
  23. Confidential – Copyright SIRIONA 2008 - 16 novembre 2012
  24. Chapter : Receiving inventory updates
  25. 9
  26. <planning from="2011-04-01" to="2011-12-30" minimumStay="1"
  27. unitPrice="340.0000" noArrival="false" isClosed="false" />
  28. </rate>
  29. <rate currency="EUR" rateCode="PACKAGE1" rateName="Package Offer">
  30. <planning from="2010-12-28" to="2010-12-28" minimumStay="1"
  31. unitPrice="380.0000" noArrival="false" isClosed="false" />
  32. <planning from="2010-12-29" to="2010-12-31" minimumStay="1"
  33. unitPrice="380.0000" noArrival="false" isClosed="false" />
  34. <planning from="2011-01-01" to="2011-01-01" minimumStay="1" unitPrice="357"
  35. noArrival="false" isClosed="false" />
  36. <planning from="2011-01-02" to="2011-03-31" minimumStay="1"
  37. unitPrice="340.0000" noArrival="false" isClosed="false" />
  38. <planning from="2011-04-01" to="2011-12-30" minimumStay="1"
  39. unitPrice="340.0000" noArrival="false" isClosed="false" />
  40. </rate>
  41. <rate currency="EUR" rateCode="RACKPRI" rateName="Public Price">>
  42. <planning from="2010-12-28" to="2010-12-28" minimumStay="1"
  43. unitPrice="380.0000" noArrival="false" isClosed="false" />
  44. <planning from="2010-12-29" to="2010-12-31" minimumStay="1"
  45. unitPrice="380.0000" noArrival="false" isClosed="false" />
  46. <planning from="2011-01-01" to="2011-01-01" minimumStay="1"
  47. unitPrice="340.0000" noArrival="false" isClosed="false" />
  48. <planning from="2011-01-02" to="2011-03-31" minimumStay="1"
  49. unitPrice="340.0000" noArrival="false" isClosed="false" />
  50. <planning from="2011-04-01" to="2011-12-30" minimumStay="1"
  51. unitPrice="340.0000" noArrival="false" isClosed="false" />
  52. </rate>
  53. </room>
  54. </inventoryUpdate>
  55. </message>
how can i read this file XML and mapping to store in data base

Thanks in advance
Jul 19 '13 #1
1 1266
Dormilich
8,658 Expert Mod 8TB
for reading XML you can use SimpleXML and DOMDocument. the mapper you have to write on your own, though.
Jul 21 '13 #2

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

Similar topics

0
by: David Lao | last post by:
Hi All, I need a way to extract Data value from the Outlook form when the new mails arrive. The data fields are provided. Thanks. David
13
by: MLH | last post by:
I have a number of reports that are essentially black 'n white prepared forms (picture an IRS form 1040). The data fields are overlaid onto the report fields in the correct positions and I would...
0
by: Tommy Christian | last post by:
Hi! Anyone who knows about saving serialized data to database, coz I have a problem with that. If I just serialize my session data and then deserialize it, it works. But when I save it...
5
by: Tony | last post by:
Ok. im new to programming. and sorry for fuzzy discription :) I am using a program called leechget. this is download manager that i use on the net. When i add a dowload , i can see the information...
1
by: pconrad | last post by:
I've got a syslog server posting to MS SQL. It works great as far as posting all the data. However, it puts all the useful information into one big text field called message. How can I parse that...
0
by: ASMJ | last post by:
Hi, I have a web page with some data fields contained in the panel and a grid view below it. The data fields are not placed in the position in which they are designed when I run the appln. After a...
1
by: =?Utf-8?B?SHVzYW0=?= | last post by:
Hi EveryBody: I made web site using asp.net 2.0 Vb.Net. The project depends on database in the local machine. The web site has • Create User Wizard and • Login form When the user is...
0
by: sijugeo | last post by:
Hi, I Have a MS word template field which have certain data fields. I want to populate the data fields using the data retrived from SQL db. How can I do this? Thanks in advance Siju george
1
by: =?Utf-8?B?SHVzYW0=?= | last post by:
Hi EveryBody: I have probelm that I hung with for three weeks, My problem is I want to read Binary data from database. I will told you what I did : first I declear an array byte and I cast the...
1
by: =?Utf-8?B?SHVzYW0=?= | last post by:
Hi EveryBody: I have probelm that I hung with for three weeks, My problem is I want to read Binary data from database. I will told you what I did : first I declear an array byte and I cast the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...

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.