Hi, Here is the problem.
I need to load the data into an Oracle Table from an XML file.
Everything is fine except there is a problem with the loaded data.
The job is loading the data with the nearest tags. To be more eloborative, let me explain the scenario.
Eg:
<address>
<name>xyz</name>
<city>abc</city>
</address>
<address>
<name>xyz1</name>
<city>abc</city>
</address>
When i load the data from the above, The data in oracle is loading like,
NAME CITY
<name>xyz</name> <city>abc</city>
<name>xyz1</name> <city>abc</city>
I am suspecting this is a problem with XPath data in the metadata def.
But i've not yet reached the solution.
Can anybody help? Thanks in advance.
XML Plug in Stage..
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 437
- Joined: Fri Oct 15, 2004 6:13 am
- Location: Pune, India
Re: XML Plug in Stage..
Are there two problems? From the post it seems u have two problems.
First
Please clarify if this what you meant by nearest tags?
Then second problem
Is this the case?
Can you post the XPaths you have used while reading the XML mentioned? Normally if the data is getting parsed properly, problem can be of XPaths.
First
To me it means, for the second row (or other rows than first), it is always reading nearest tags data instead of correspoding data from row. So for XML you have mentioned, are you getting values xyz for both rows?prasadnittala wrote:The job is loading the data with the nearest tags.
Please clarify if this what you meant by nearest tags?
Then second problem
Which looks like - data loaded in the table is with tags i.e. instead of storingxyz it is stroring <name>xyz</name> i.e. with tags?prasadnittala wrote:When i load the data from the above, The data in oracle is loading like,Code: Select all
NAME CITY <name>xyz</name> <city>abc</city> <name>xyz1</name> <city>abc</city>
Is this the case?
Can you post the XPaths you have used while reading the XML mentioned? Normally if the data is getting parsed properly, problem can be of XPaths.
Last edited by Kirtikumar on Mon Oct 23, 2006 11:00 pm, edited 1 time in total.
Regards,
S. Kirtikumar.
S. Kirtikumar.
-
- Participant
- Posts: 437
- Joined: Fri Oct 15, 2004 6:13 am
- Location: Pune, India
-
- Participant
- Posts: 4
- Joined: Mon Sep 11, 2006 10:47 am
Re: XML Plug in Stage..
Apologies for the ambiguity. Here is the example I used.
SOURCE FILE CONTENTS:
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <CATALOG>
- <CD>
<TITLE>Empire Burlesque</TITLE>
<ARTIST>Bob Dylan</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>Columbia</COMPANY>
<PRICE>10.90</PRICE>
<YEAR>1985</YEAR>
</CD>
- <CD>
<TITLE>Hide your heart</TITLE>
<ARTIST>Bonnie Tylor</ARTIST>
<COUNTRY>UK</COUNTRY>
<COMPANY>CBS Records</COMPANY>
<PRICE>9.90</PRICE>
<YEAR>1988</YEAR>
</CD>
XPath Defs (From Metadata):[/b]
/CATALOG/CD/TITLE/text()
/CATALOG/CD/ARTIST/text()
/CATALOG/CD/COUNTRY/text()
/CATALOG/CD/COMPANY/text()
/CATALOG/CD/PRICE/text()
/CATALOG/CD/YEAR/text()
ORACLE OUTPUT:
<table border=1>
<tr>
<th>TITLE</th>
<th>ARTIST</th>
<th>COUNTRY</th>
<th>COMPANY</th>
<th>PRICE</th>
<th>YEAR</th>
</tr>
<tr>
<td><TITLE>Empire Burlesque</TITLE></td>
<td><ARTIST>Bob Dylan</ARTIST></td>
<td><COUNTRY>USA</COUNTRY></td>
<td><COMPANY>Columbia</COMPANY></td>
<td><PRICE>10.90</PRICE></td>
<td><YEAR>1985</YEAR></td>
</tr>
<tr>
<td><TITLE>Hide your heart</TITLE></td>
<td><ARTIST>Bonnie Tylor</ARTIST></td>
<td><COUNTRY>UK</COUNTRY></td>
<td><COMPANY>CBS Records</COMPANY></td>
<td><PRICE>9.90</PRICE></td>
<td><YEAR>1988</YEAR></td>
</tr>
</table>
SOURCE FILE CONTENTS:
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <CATALOG>
- <CD>
<TITLE>Empire Burlesque</TITLE>
<ARTIST>Bob Dylan</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>Columbia</COMPANY>
<PRICE>10.90</PRICE>
<YEAR>1985</YEAR>
</CD>
- <CD>
<TITLE>Hide your heart</TITLE>
<ARTIST>Bonnie Tylor</ARTIST>
<COUNTRY>UK</COUNTRY>
<COMPANY>CBS Records</COMPANY>
<PRICE>9.90</PRICE>
<YEAR>1988</YEAR>
</CD>
XPath Defs (From Metadata):[/b]
/CATALOG/CD/TITLE/text()
/CATALOG/CD/ARTIST/text()
/CATALOG/CD/COUNTRY/text()
/CATALOG/CD/COMPANY/text()
/CATALOG/CD/PRICE/text()
/CATALOG/CD/YEAR/text()
ORACLE OUTPUT:
<table border=1>
<tr>
<th>TITLE</th>
<th>ARTIST</th>
<th>COUNTRY</th>
<th>COMPANY</th>
<th>PRICE</th>
<th>YEAR</th>
</tr>
<tr>
<td><TITLE>Empire Burlesque</TITLE></td>
<td><ARTIST>Bob Dylan</ARTIST></td>
<td><COUNTRY>USA</COUNTRY></td>
<td><COMPANY>Columbia</COMPANY></td>
<td><PRICE>10.90</PRICE></td>
<td><YEAR>1985</YEAR></td>
</tr>
<tr>
<td><TITLE>Hide your heart</TITLE></td>
<td><ARTIST>Bonnie Tylor</ARTIST></td>
<td><COUNTRY>UK</COUNTRY></td>
<td><COMPANY>CBS Records</COMPANY></td>
<td><PRICE>9.90</PRICE></td>
<td><YEAR>1988</YEAR></td>
</tr>
</table>
prasad