Page 1 of 2

XML OUTPUT

Posted: Tue Dec 07, 2010 5:58 am
by karry450
Hi Friends,

My source is a flat file and output is xml output stage.

targeted output is :
<fileUpdate version="1" program="2" vendor="1" createDate="2010-12-07 06:52:14" serviceType="2">
0000000000000000001.
<fileList>
<file preReqFile="" id="1086734.10251.0.Z" sum="3574437120">
<store ncpdp="1086734"></store>
</file>
<file preReqFile="" id="1614608.10250.0.Z" sum="879672064">
<store ncpdp="1614608"></store>
</file>
</fileList>
</fileUpdate>




My output:
<fileUpdate version="1" program="2" vendor="1" createDate="2010-12-07 06:52:14" serviceType="2">
0000000000000000001.
<fileList>
<file preReqFile="" id="1086734.10251.0.Z" sum="3574437120">
<store ncpdp="1086734"></store>
</file>
</fileList>
</fileUpdate>
<fileUpdate version="1" program="2" vendor="1" createDate="2010-12-07 06:52:14" serviceType="2">
0000000000000000001.
<fileList>
<file preReqFile="" id="1614608.10250.0.Z" sum="879672064">
<store ncpdp="1614608"></store>
</file>
</fileList>
</fileUpdate>


Can any one help me how to acheive this.

Just to make it easy my targetted output is writing one header and one footer for whole lot of records.
But when I run my ds job my output is writing one header and one footer for each and every record.

Thanks

Re: XML OUTPUT

Posted: Tue Dec 07, 2010 7:22 am
by samyamkrishna
Hi,

go through the xmlbestpractices.zip which is located at the site http://Duke-Consulting.com

Re: XML OUTPUT

Posted: Fri Dec 10, 2010 1:10 am
by karry450
Hi Friends,

Im getting this message on top of my xml file,
<?xml version="1.0" encoding="ISO-8859-1"?>
Can anyone help me/suggest how to remove this message from the file

regards
goutam

Re: XML OUTPUT

Posted: Fri Dec 10, 2010 2:54 am
by Vignesh Shanmugam
In XML Output Stage Go to
1).Output tab
2).Click on Comment Tab
3).check in the Include Check box.

This will remove the header


-Vignesh

Re: XML OUTPUT

Posted: Fri Dec 10, 2010 3:05 am
by karry450
Hi Vignesh,

I have tried this , This is xml output stage , i have checked comment in stage tab --->document settings tab but doesnt remove the header
can you please suggest if there is any other way.

Thanks

Re: XML OUTPUT

Posted: Fri Dec 10, 2010 3:13 am
by samyamkrishna
How many XML Output stages do you have.

You have unchek the Include comment in all the XML output stages.

Re: XML OUTPUT

Posted: Fri Dec 10, 2010 3:23 am
by karry450
Hi krishna,

I have only one output stage, I have unchecked and checked doesnt may any difference. Still showing the header

Any other options to do please help

Thanks
Goutam

Re: XML OUTPUT

Posted: Fri Dec 10, 2010 3:25 am
by samyamkrishna
Can you post the xml here. I would like to have a look.

Re: XML OUTPUT

Posted: Fri Dec 10, 2010 3:40 am
by karry450
Hi Krishna,

<?xml version="1.0" encoding="ISO-8859-1"?>
<fileUpdate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1" program="XXXX" vendor="XXXXX" createDate="2010-12-10 01:50:11" serviceType="2">
<fileList>
<file sum="3574437120" preReqFile="" id="100000.00000.0.Z">
<store ncpdp="000000"/>
</file>
</fileList>
</fileUpdate>

The one in bold I want to remove that and I want to add the below as header.

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>

Can you please suggest how can I achieve this.

Posted: Fri Dec 10, 2010 3:45 am
by ray.wurlod
Ereplace() in a downstream Transformer stage.

Posted: Fri Dec 10, 2010 3:53 am
by karry450
Hi Ray,

This is no the input column this header is generated in xml oupt stage which is my target as

<?xml version="1.0" encoding="ISO-8859-1"?> where as I want it to be as

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>

which I can add in the header tab if I can remove the default header
<?xml version="1.0" encoding="ISO-8859-1"?>

thanks

Posted: Fri Dec 10, 2010 4:19 am
by samyamkrishna
You can remove it by checking generate XML chunk

Try it out

Posted: Fri Dec 10, 2010 4:28 am
by karry450
Hi Krishna,

I can remove it by checking generate XML chunk but I can add my own header, The header tab diappears when we check box for generate xml chunk.

Posted: Fri Dec 10, 2010 4:51 am
by samyamkrishna
I guess the only way to do it add another column before the XML Output stage and hardcode it with your value.

<?xml version="1.0" encoding="ISO-8859-1"?>

Posted: Fri Dec 10, 2010 5:08 am
by samyamkrishna
You might hav eto wait for eostics reply on this post.