Home » Developer & Programmer » JDeveloper, Java & XML » List all Tag and Field Names in XML (Oracle 11g)
List all Tag and Field Names in XML [message #654698] Wed, 10 August 2016 10:33 Go to previous message
lokimisc
Messages: 101
Registered: February 2008
Senior Member
Hi,
I'm working on a program which reads xml files and list all tags and their corresponding child fields which will be used to compare against the table and columns created in database.
Could anyone please help in listing tags and field names from xml file.
Input XML File:
<ordering>
  <order>
    <orderNumber>316</orderNumber>
    <OrderName>MOBILE</OrderName>
    <BusinessType>COMMERCIAL</BusinessType>
    <OrderStatus>PENDING</OrderStatus>
  <shipto>
    <name>Ola Nordmann</name>
    <address>Langgt 23</address>
    <city>4000 Stavanger</city>
    <country>Norway</country>
  </shipto>
  <item>
    <title>Empire Burlesque</title>
    <note>Special Edition</note>
    <quantity>1</quantity>
    <price>10.90</price>
  </item>
  </order>
<ordering>

Output ( It can be inserted into table, if required )
TagName	FieldName
ordering	NULL
order	orderNumber
order	OrderName
order	BusinessType
order	OrderStatus
shipto	name
shipto	address
shipto	city
shipto	country
item	title
item	note
item	quantity
item	price

Thanks and Regards,
Lokesh
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IFrame PHP and JDeveloper JavaScripts
Next Topic: Loading XML in Oracle table
Goto Forum:
  


Current Time: Fri Apr 26 12:42:49 CDT 2024