IBM Support

How do you remove the xmlns attribute from the output root element generated by a map?

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:

  1. Open the map in the Design Studio
  2. 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
  3. After right clicking on http://www.example.com/IPO, left click on Delete
  4. Click on OK
  5. Rebuild the map
  6. 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":{"code":"SSVSD8","label":"IBM Transformation Extender"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"--","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF025","label":"Platform Independent"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"},{"code":"PF035","label":"z\/OS"}],"Version":"8.3;8.4;8.4.1","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Product Synonym

Mercator Ascential DataStage TX WTX

Document Information

Modified date:
16 June 2018

UID

swg21677123