John
John

Reputation: 69

Informatica XML target Add xmlns and xsi to root and add custom tag

I loaded an XML file via the "Import XML definition" and everything worked fine. But the XML needs the following added to it

Here is my question,

I just have the XML but not the xsd.

  1. How do I add the xmlns and xsi string into the root node?
  2. For the elements, how do I add the tag like 'common' and 'udf' before the column name like common:abbreviation or udf:name or udf:value?

Basically is there an easy and quick way to do this? Do I need to reimport the files with new xsd?

Thanks

    <MyRoot
       xmlns:udf="http://www.url.com/xx/XXXX/type1" 
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                    xmlns:common="http://www.url.com/xx/XXXX/common"
            xmlns="http://www.url.com/ws/v410/NewPerson" 
                    xsi:schemaLocation="http://www.url.com/xx/XXXX/NewPerson NewPerson.xsd"
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 

<common:ID>NNNNNNNNNN</common:ID>
<UDF>
                        <udf:name>Name Content</udf:name>
                        <udf:value></udf:value>
                    </UDF>
    </MyRoot>

Upvotes: 0

Views: 712

Answers (1)

Maciejg
Maciejg

Reputation: 3353

I've written a post about adding ports to XML transformation. See if this helps: http://powercenternotes.blogspot.com/2013/03/adding-port-to-existing-xml-parser.html

Upvotes: 1

Related Questions