Complex XML document

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Shukile
Participant
Posts: 6
Joined: Thu Oct 21, 2010 7:48 am

Complex XML document

Post by Shukile »

<Moderator: split from this topic>

hi.

Regarding the last question,
i merged the chunk xml with transformer:
in the deviration i put somthing like :

'<street>' : seq_addr_in.STREET :
'</street><city>' : seq_addr_in.CITY :
'</city><state>' : seq_addr_in.STATE :
'</state><zip_code>' : seq_addr_in.ZIP_CODE : '</zip_code>'

in the final document i get all the tags in one row
how can i split the tags to diffrent rows ?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Really no need to do that for XML, but you could force it by including a record delimiter between each. Use CHAR(13):CHAR(10) for Windows or just a CHAR(10) for UNIX.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Shukile
Participant
Posts: 6
Joined: Thu Oct 21, 2010 7:48 am

Post by Shukile »

Hi Craig.

Im building a complex XML document as shown in 'Xml Best Practices'
document, if you familiar with it.
and this is the part of the addresses (3.1.3.1.2)

Do you have a better way to to that example ?

Basically i need to create XML document with one file_header record in the begining and alot of data records so i used the above examlpe.

this is what i need

<?xml version="1.0"?>

<File_Header>
<RecordType>x</RecordType>
<ActionCode>abcs</ActionCode>
<NumberOfRecords>1</NumberOfRecords>
<ProviderCode>1</ProviderCode>
<FileReference>123</FileReference>
<DateFile>201010130945</DateFile>


<Data>
<DataType>D</DataType>
<IdentificationNumber>321423166</IdentificationNumber>
<CustomerNumber>25252</CustomerNumber>
<PayingCustomerNumber>5555</PayingCustomerNumber>
<RequestType>1</RequestType>
<IpostNumber>RT7654</IpostNumber>
<ErrorCode>5</ErrorCode>
<ErrorDescription>aaaaa</ErrorDescription>
</Data>

<Data>
<DataType>D</DataType>
<IdentificationNumber>35765466</IdentificationNumber>
<CustomerNumber>25252</CustomerNumber>
<PayingCustomerNumber>5555</PayingCustomerNumber>
<RequestType>1</RequestType>
<IpostNumber>RT7654</IpostNumber>
<ErrorCode>5</ErrorCode>
<ErrorDescription>aaaaa</ErrorDescription>
</Data>

</File_Header>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I don't see the correlation between the first question and this one, or with the other post which is why I split this one off. And I'm not sure how 'complex' what you are trying to do is. However, it seems like building those <Data> elements as chunks and then merging them together with the header XML should work fine.

What exactly are you doing and what issues are you having? Getting your output all in "one row" isn't really a problem as long as the XML is valid. Can you try again to clarify your question, please?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Shukile
Participant
Posts: 6
Joined: Thu Oct 21, 2010 7:48 am

Post by Shukile »

Hi

I tried your suggestion to use char(13) and char(10) and it works.
I get a valid XML. I just wanted to split it into several rows.
Thank you very much for your help
:)
Post Reply