Written by

Senior Developer at Greater Manchester Mental Health Services
Question Andy Stobirski · Dec 29, 2021

Adding multiple namespaces in an XML file

Hi

I'm using a class which extends %XML.Adaptor adaptor and I want to create an XML file with multiple namespaces, like the following:

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
</soap>

However, I don't see how to do this with the code I have. So far, I have

Class GMMHTIE.Docman.Messages.Request.RequestWrapper Extends (%Persistent, %XML.Adaptor){ Parameter XMLNAME = "soap:Envelope";
 Parameter NAMESPACE = "http://www.w3.org/2001/XMLSchema-instance";
 Parameter XMLPREFIX = "xsi";}

which produces the following, which  confuses me.

<soap:Envelope xmlns="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
</soap:Envelope>

Can anyone help, please?

Andy

Product version: IRIS 2021.1
$ZV: RIS for Windows (x86-64) 2020.1 (Build 215U) Mon Mar 30 2020 20:14:33 EDT

Comments

Eduard Lebedyuk · Dec 30, 2021

Each individual tag can belong to only one namespace. Just add all the tags with their relevant namespaces and it should work.

0
Andy Stobirski  Dec 30, 2021 to Eduard Lebedyuk

I'm sorry, but I don't understand what that means.

0