Question & Answer
Question
How do you remove the xmlns attribute from the output root element generated by a WebSphere Transformation Extender (WTX) map?
Cause
By default, when WebSphere Transformation Extender (WTX) maps using xml output are executed, the root tag includes the xml namespace as an attribute when it is specified in the reference schema.
Using the example ipo.mms, validationMap, that is included with WTX as an example, the default output starts with:
<?xml version="1.0"?>
<ipo-out:purchaseOrders xmlns:ipo-out="http://www.example.com/IPO">
test mixed data #1
<order orderDate="2004-12-01">test mixed data #2<shipTo>
Notice how the xmlns attribute is present.
Answer
If you do not want the xmlns attribute to be present, take the steps outlined below:
- Open the map in the Design Studio
- Edit the output card in question (in this case output card 1 of the validationMap map) and expand it so you can right click on Property > Schema > Type > Metadata > Name Spaces > http://www.example.com/IPO
- After right clicking on http://www.example.com/IPO, left click on Delete
- Click on OK
- Rebuild the map
- Run the map
This will result in an output file that starts with:
<?xml version="1.0"?>
<purchaseOrders>
test mixed data #1
<order orderDate="2004-12-01">test mixed data #2<shipTo>Please note that if you edit this card again and rebuild the map, the behavior will revert to the default of generating the xmlns attribute on the output root element. If you inadvertently rebuild the map, take the above listed steps again to remove the xmlns attribute from your output.
Product Synonym
Mercator Ascential DataStage TX WTX
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21677123