xml input not replicating the output

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Kumudhini
Participant
Posts: 3
Joined: Tue Feb 27, 2007 10:39 pm

xml input not replicating the output

Post by Kumudhini »

Hai All,
iam struck while working with xml stages. I will be gratefull if anybody helps me to resolve.
Craig Hulett, as Smeitei is also facing a similar problem i thought Joining in the existing group will be easier for

discussion. I understand that i cannot create a rappot when i come inbetween.

Aim:To change the values of the xml elements.(eg:foster to sanjose)
Design:The design goes as Folder->xmlInput->seqfile->transformer->seqfile->xmloutput.

Description:I created the table definitions using the XML Meta Data Importer. At present neither xsd not xslt were used.

The transformer stage were used to change the values under some conditions. The seq files are for perseverance.
XMLInput/Output:
repetition element required unchecked.
Validate input, enable grammar caching xml checked
column def:id, name, city all are varchar.
replace null..,replace empty.. both are checked
Other options set to default.

My project's xml file is very big. i spotted out the errors in outputfile. To work smartly i created a sample xml that could

produce the same error by having a similar hierarchy. when the repetation element is "city", the i/o are as follows.
input:
<?xml version="1.0" encoding="UTF-8"?>
<customers>
<customer id="5000">
<name>mike</name>
<address><city>redwood</city></address>
<address><city>foster</city></address>
<name>nandy</name>
</customer>
</customers>

output:
<?xml version="1.0" encoding="UTF-8"?>
<customers>
<customer id="5000">
<name>mike</name>
<address><city>redwood</city><city>foster</city></address>
</customer>
</customers>

Inferrence:
1)The redwood and foster cities should come under different parent elements that is "address".
2)The name nandy was missing.

Regards,
Kumudhini.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ok. :?

"The seq files are for perseverance".

Meaning what, exactly? Just so you can see the intermediate output? That's fine as long as you realize you don't need them in the job design for it to function.

Design: Folder->xmlInput->transformer->xmloutput

Is all you really 'need'.

"Other options set to default."

On the Transformation Settings tab of the XML Output stage, what is the Output Mode set to? If it is set to 'Aggregate all rows' try changing it to 'Single row' and see how the output changes.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Kumudhini
Participant
Posts: 3
Joined: Tue Feb 27, 2007 10:39 pm

Post by Kumudhini »

Hai,
The problem is with the xmlInput that didnot fetch all the elements. This can be seen using the sequential file that comes inbetween the xmlinput and the transformer. when "aggregate all rows" is changed to "single row" in the outputXML, obviously it doesnot resolve.
Can you refer the "XMLPACK_20_Designer" page 44(3 - 8 ).
When the repetition element(the primary key) is "name", the xmlInput stage will partially read and the seq files has
5000 mike redwood
5000 nandy redwood
when it is city:
5000 mike redwood
5000 mike foster
At a time there can be only one primary key and one set is read. So on the whole i dont know how to read all the possible combinations.

regards,
kumudhini.
Rimi
Participant
Posts: 8
Joined: Wed Feb 28, 2007 10:25 am

Post by Rimi »

Hi Chulett ,

I am also facing the same problem as discussed above.My output xml is not reflecting same as input xml.

You gave me the solution to try with output mode of Xml output stage in 'Single Row' .But if i do like this then nearly 300 output files were generated.

Is the problem with key value ? But there are many repeating groups so which one can i take as key column .
Can anyone help me over this,

Thanks,
Rimi.
chulett wrote:This sounds very similar to this post - are you perhaps working on the same problem? If so, let's please keep this to one discussion not two. Thanks.

If not - same question as in the other thread: what is your Output Mode set to? Try 'Single Row' if you have been aggregating rows.
Post Reply