Page 1 of 1

Repetition element in xml input and output stage

Posted: Wed Aug 30, 2006 11:28 pm
by parvathi
Hi..

I have developed a job with two sequential stage and exported the job as xml file.. Ihave used the this xml file as an input in the xml input stage... Here in this we have to specify a repition element on which the output xml wil be generated....

here i have a doubt on what basis you select the repetition element or the key element...

I have tested with all the meta data columns genetrated from the xml meta data importer tool ... i was able to get the data but it is not in the exact format in which the input xml file was generated...


can anybody help me in selecting the repetition element....??

Posted: Thu Aug 31, 2006 1:16 am
by Kirtikumar
Repitition element is column something like a primary key in table. While generating the XML, XML records are generated according the value in this col.

So if you have to generate XML for employee table, empno will be your Repitition element. Now the generated XML will have those many records as per the input Empl table.

If your repitition element is other than Empno then your output XML may not be proper and may have multiple root tags or two empl records can be considered as single record.

Posted: Thu Aug 31, 2006 3:17 am
by ray.wurlod
You do NOT process exported metadata as if it were data. It's just bad practice - and the style sheets do not provide any information about relationships and dependencies; your next question is doubtless being unable to import DataStage components from the modified XML. You're on your own here!

Re: Repetition element in xml input and output stage

Posted: Mon May 04, 2009 5:16 am
by manu.dwhds
parvathi wrote:Hi..

I have developed a job with two sequential stage and exported the job as xml file.. Ihave used the this xml file as an input in the xml input stage... Here in this we have to specify a repition element on which the output xml wil be generated....

here i have a doubt on what basis you select the repetition element or the key element...

I have tested with all the meta data columns genetrated from the xml meta data importer tool ... i was able to get the data but it is not in the exact format in which the input xml file was generated...


Hi ,

Now i got your question if you want to find repetition element we have few ways to find:

1) in xml file find which one is lowest grain means key column for that Unique element.
2) if any repetition segemts is there you need to care and extarct separatly using in that segemnt lowest grain key column.
3)find xsd there we can find which segment Max Occures and Min occures so that we need to extract separatly taking as a differnt key columns.

can anybody help me in selecting the repetition element....??

Posted: Mon May 04, 2009 6:33 am
by chulett
That is not how you quote someone. Did you Preview this before you submitted it? :?

Posted: Mon May 04, 2009 7:59 am
by eostic
Indeed...it's not entirely clear what your question is.

However, if the question is about how to find the repetition element, here are some guidelines:

a) first determine what information you need/want from the xml docs.
b) determine if the information you want is on the same "path". This is usually the hardest part. You need to look at resources like an xsd, and also some actuall document instances. If two nodes repeat at the same level, then they have to be dealt with separately (each via the own output link). A primitive example of that might be an employee file. For each higher level person node, there might be a node for "job titles," with a repeating element for every position the person has ever held in the company, and another node for "dependents"....with a repeating element for their partners and children. Two links, minimum, would be needed ,each with their own "repeating element".
c) decide upon the "lowest level" in the hierarchy that you care about for retrieval. In the example above, perhaps job criteria, with job name, description, salary at that job, etc. are important.
d) for XMLInput (reading) choose any element in that lowest level as your repetition element.
e) for writing it's a bit more complex, and you will benefit by choosing an element whose values are unique.

Ernie