Page 1 of 1

XML property clarification

Posted: Sat Aug 31, 2013 6:47 am
by vamsi.4a6
I am using XML input stage first time.Not sure about these properties.Any body input is really appreciated

1)What is meant by Repetition element required present in Transformation setting of stage tab?
2)What is meant by Repetition element required present in Transformation setting of output tab?
3)What is difference between these two?
4)I am working on XML file and how to decide whether it has namespace declaration or not?


I am posting these question after going through manual.

Posted: Sat Aug 31, 2013 9:16 am
by chulett
Have you ever worked with XML before? I don't mean in DataStage, I mean at any point. Just trying to judge your familiarity with XML... guessing it is new to you.

Posted: Sat Aug 31, 2013 10:32 pm
by vamsi.4a6
@Chullet.
NO.I am new to XML and i posted the question after going through Manual

Posted: Sun Sep 01, 2013 12:44 pm
by eostic
That' great, and welcome to the world of xml ---- but start first with serarches thru the forum here on these definitions and generally in google ---- you will find hundreds of posts here and in general that wwill answer the basics. Then let us know if/where you get stuck.

Posted: Mon Sep 02, 2013 2:59 pm
by chulett
Let's keep your questions in your posts rather than jumping on the end of old ones. Moved this one here:
vamsi.4a6 wrote:Could anybody please elaborate on How to find the 'lowest' element as the Repetition element?
Lowest as in 'deepest'... as in the number of levels down the hierarchy. More of an art than a science, I was a big fan of "pick one and see if it works" back when I had to deal with XML on a daily basis.

Ernie may have a more cogent answer, being our resident XML Wizard. :wink:

Posted: Mon Sep 02, 2013 4:23 pm
by ray.wurlod
Perhaps the XPath expression with the greatest number of delimiters?

Posted: Mon Sep 02, 2013 5:14 pm
by eostic
The repetition element (the one you mark as a "key") is simply an indicator that this is the deepest level that "I care about for retrieval"....usually it is "the bottom" of a particular nested path...but it doesn't have to be.

It has NOTHING to do with the word "key" ...that is merely an indicator that this is the repeating group that you want to use to define each repeating "row".

Pick an element that you know will exist all the time, if possible.

You ALWAYS need to select ONE repeating element for each output link or the Job will abort at run time.

Then.....if you have "repetition element required" checked elsewhere in the Stage, it says that the element must exist for you to receive a row for that repeating node. If it is not required, then you can retrieve the parent and null for the repeating element node. If required and it doesn't exist, then you lose the parent value also. To understand this, think about an xml document with many departments for a company and employees under the department. If you have a department that has no employees, then THAT department won't be retrieved if the repeating element is required and at the employee level.

Ernie

Posted: Tue Sep 03, 2013 7:41 am
by chulett
Thanks Ernie. 8)