XML Namespace inclusion using XMLWriter Stage

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
aolasoji_2
Participant
Posts: 9
Joined: Sun Sep 26, 2004 8:21 pm
Location: Melbourne

XML Namespace inclusion using XMLWriter Stage

Post by aolasoji_2 »

I am trying to create an XML message using the XML Pack but could not include the namespace definition and a context XML within the generated XML. What I want to do is something like.

<CreateRequest:CreatePerson>
xmlns:Common="http://...../cs/Common"
xmlns:CreatePerson="http://....../cs/CreatePerson"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://..../cs/CreatePerson
CreatePerson.xsd">
<Context>
<Version>02</Version>
<MessageID>20888</MessageID>
</Context>
<Person>
<ID>001828210</ID>
<Type>COMPANY</Type>
<AddressSet>
<Address>
:
:
</Address>
</AddressSet>
</Person>
</CreateRequest:CreatePerson>

Now I was able to create the message but could not include the namespace and the context below:

xmlns:Common="http://...../cs/Common"
xmlns:CreatePerson="http://....../cs/CreatePerson"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://..../cs/CreatePerson
CreatePerson.xsd">
<Context>
<Version>02</Version>
<MessageID>20888</MessageID>
</Context>
Using the Include file or XML option of the XMLWriter resulted in the namespace and context being included under the root tags.

I was able to include the two item using the XMLOutput Stage but the stage could not handle repeating data which the XMLWriter stage handled without a problem. I have an input of the structure:

ID Name Address Date
=== ===== ===== ====
1 AAAA CCCCC
1 DDDDD
1 2004-06-12
2 BBBB AAAAA
2 2005-07-02

Anybody out there with any idea of how I can get round this problem.
Post Reply