Page 1 of 1

XML Namespace inclusion using XMLWriter Stage

Posted: Tue Oct 04, 2005 12:21 am
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.