Hi all,
I'm converting xml files to structures using Simple transformations. These xml's have some namespaces that I'd like to ignore but I need to declare them in the transformation for it to work.
For example here's an XML I want to transform to a structure
<Product xmlns="http://Product/types">
<Name xmlns="http://Name/types">Laptop</Name>
<Price xmlns="http://Price/types">499</Price>
</Product>
I though this would be enough:
<?sap.transform simple?>
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates" xmlns:ddic="http://www.sap.com/abapxml/types/dictionary" xmlns:def="http://www.sap.com/abapxml/types/defined">
<tt:root name="PRODUCT" type="ddic:ZPRODUCT_STRUCTURE"/>
<tt:template>
<Product>
<Name tt:value-ref=".PRODUCT.NAME"/>
<Price tt:value-ref=".PRODUCT.PRICE"/>
</Product>
</tt:template>
</tt:transform>
But it doesn't work unless I include the namespace in the transformation like this:
<?sap.transform simple?
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates" xmlns:ddic="http://www.sap.com/abapxml/types/dictionary" xmlns:def="http://www.sap.com/abapxml/types/defined">
<tt:root name="PRODUCT" type="ddic:ZPRODUCT_STRUCTURE"/>
<tt:template>
<Product xmlns="http://Product/types">
<Name xmlns="http://Name/types" tt:value-ref=".PRODUCT.NAME"/>
<Price xmlns="http://Price/types" tt:value-ref=".PRODUCT.PRICE"/>
</Product>
</tt:template>
</tt:transform>
The documents I'm working with have 100's of these namespaces so I'd be great if there is a way to do this without declaring them in the transformation. There is also a risk of these namespaces changing an then all of a sudden the transformation doesn't work.
Is there an option to have the transformation ignore the namespaces in the xml to be processed?
Thanks,
Birgir Snorrason