Read From XML
Moderators: chulett, rschirm, roy
Read From XML
All,
I have a XML file which is defined as below:
<XML deffinition..>
<endheadertag>
- <sets>
- <set id="0">
. <differents sub-tag>..
.
.
</sets>
my sets tag is repeted less(3times) than my promotions tags(15 times)
<promotions>
.
.
</promotoions>
</endheadertag>
it seems to merge 2 differents axe of XML,
and i am trying to read this xml from xml output but get some strange error
do i have to split them before reading? if yes how to do so?
can anyone explaine in detail what am i wrong for reading my xml?
i use external source and read my xml by ls xmlfile.xml command
then using xml_input
defining/stage/ validate input xml, etat=reject,error=reject,warning=reject
transformation setting/repetation element required, replace emty valu with nulls
input/ xml source coloumn define my input record from external source
-xml document checked
Output/transformation setting -includ namespace declaration('i loaded my schema md5..)
and define a second output for my reject
but where is the problem to read this file?
i am reading the both tags in one times but does not work,
tryed to read them seperately from same xml file, did not work !
i indeed defined description as required
any helps plz?
thank you
I have a XML file which is defined as below:
<XML deffinition..>
<endheadertag>
- <sets>
- <set id="0">
. <differents sub-tag>..
.
.
</sets>
my sets tag is repeted less(3times) than my promotions tags(15 times)
<promotions>
.
.
</promotoions>
</endheadertag>
it seems to merge 2 differents axe of XML,
and i am trying to read this xml from xml output but get some strange error
do i have to split them before reading? if yes how to do so?
can anyone explaine in detail what am i wrong for reading my xml?
i use external source and read my xml by ls xmlfile.xml command
then using xml_input
defining/stage/ validate input xml, etat=reject,error=reject,warning=reject
transformation setting/repetation element required, replace emty valu with nulls
input/ xml source coloumn define my input record from external source
-xml document checked
Output/transformation setting -includ namespace declaration('i loaded my schema md5..)
and define a second output for my reject
but where is the problem to read this file?
i am reading the both tags in one times but does not work,
tryed to read them seperately from same xml file, did not work !
i indeed defined description as required
any helps plz?
thank you
Re: Read From XML
How did you create your XPath Expressions?
![Confused :?](./images/smilies/icon_confused.gif)
Do we have to guess the "strange error" you are getting?behrouz wrote:i am trying to read this xml from xml output but get some strange error
![Confused :?](./images/smilies/icon_confused.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Re: Read From XML
LOL, thank you for your reply,chulett wrote:How did you create your XPath Expressions?
Do we have to guess the "strange error" you are getting?behrouz wrote:i am trying to read this xml from xml output but get some strange error
in fact i just got the error XML_Input_114,0: Operator terminated abnormally: received signal SIGILL
main_program: Step execution finished with status = FAILED.
but i solved it,
now i need to know how to define the key when you have different deffinition in different sub-tag?
eg
if you have
<my_tag>
<tag1>
<val>sqsdqsd<\val>
<val>aaa<\val>
<val>bbb<\val>
</tag1>
<shop>
<tel>09777</tel>
<fax>098</fax>
</shop>
<tag1>
<val>sqsdqsd<\val>
<val>aaa<\val>
</tag1>
<shop>
<tel>09777</tel>
<tel>0987</tel>
<tel>0987</tel>
<tel>0987</tel>
<fax>098</fax>
</shop>
what do i have to define as key? val or tel? the both is not possible
i ca not extract all expected data, i extract only a part of them
thank you
Spend some time reviewing many of the xml threads here in the forum.
The key here is to have a separate link for each repeating "path" for which you want rows....
Create an independent table definition from the xml importer for each of those nodes. Include their common parent info. Make the "key" on each link a member of the repeating node (one for the "15" and another for the "3")....
...downstream you can join those links together if you feel it is necessary, although in most parsing scenarios where you are targeting an rdbms, the target is already normalized along those paths...
Ernie
The key here is to have a separate link for each repeating "path" for which you want rows....
Create an independent table definition from the xml importer for each of those nodes. Include their common parent info. Make the "key" on each link a member of the repeating node (one for the "15" and another for the "3")....
...downstream you can join those links together if you feel it is necessary, although in most parsing scenarios where you are targeting an rdbms, the target is already normalized along those paths...
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
You seem to be missing a vital point on how things work here, many many people can see the entirety of Ernie's always very helpful posts.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Well...the advice in my last post is "the" answer for multiple repeating nodes, regardless of whether additional searching in the forum was done or not.
Ernie
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>