Page 1 of 1

Read From XML

Posted: Wed Apr 27, 2011 3:43 am
by behrouz
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

Re: Read From XML

Posted: Wed Apr 27, 2011 6:47 am
by chulett
How did you create your XPath Expressions?
behrouz wrote:i am trying to read this xml from xml output but get some strange error
Do we have to guess the "strange error" you are getting? :?

Re: Read From XML

Posted: Wed Apr 27, 2011 7:01 am
by behrouz
chulett wrote:How did you create your XPath Expressions?
behrouz wrote:i am trying to read this xml from xml output but get some strange error
Do we have to guess the "strange error" you are getting? :?
LOL, thank you for your reply,

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

Posted: Wed Apr 27, 2011 7:53 am
by eostic
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

Posted: Fri Apr 29, 2011 12:06 am
by behrouz
thank you all,
it s sure before sending any post i do some search
but i expected some help from experts here which was not the case,

i solved

Regards
Behrouz

Posted: Fri Apr 29, 2011 6:32 am
by chulett
behrouz wrote:but i expected some help from experts here which was not the case
How was that "not the case"? You got help from the expert here. :?

Posted: Fri Apr 29, 2011 6:45 am
by behrouz
Do you see any helpful reply here? please read them, i just had some advice to do some search wich i did before and did not find

i do not see any help here lol :-)
but i hope for the other post are not the same as myne

Posted: Fri Apr 29, 2011 6:51 am
by chulett
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.

Posted: Fri Apr 29, 2011 10:52 am
by eostic
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