2014 May 08 4:58 PM
Hi Gurus!
I am new to transformations and I am having an issue that's revealing to be to mutch for me.
<?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" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<tt:root name="DOCUMENT" type="ddic:Z3FI_SEPA"/>
<tt:template>
<DOCUMENT>
Line 5 has an attribute with a literal value. This attribute is there because a version of XML file that I am trying to deserialize has this atribute in his <DOCUMENT> element:
<?xml version="1.0" encoding="utf-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<CstmrCdtTrfInitn>
Now I need to deserialize another document that is almost the same (with some additional non obligatory fields) but wiht atribute xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.003.02".
Is there a way to remove/discard/ignore this attribute?
Thank you guys!
Best regards,
Carlos
2014 May 08 5:59 PM
Hi Carlos,
maybe you can move the xmlns attribute to the DOCUMENT tag and use
tt:cond frq="?" to conditionally use one of them, like:
<tt:template>
<tt:group>
<tt.cond frq="?">
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03">......
</tt.cond>
<tt.cond frq="?">
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.02">......
</tt.cond>
</tt:group>
</tt:template>
I'm almost sure it won't work because it's a different attribute and not a different tag, but you might try it.
Other thing that should work is a tt:lax="on" but it surely won't.
Anyway I can't try and confirm it now, but you might.
regards,
Edgar