‎2009 Mar 30 1:10 PM
Hello,
I am tying to map XML to ABAP(deserialize) but receive a CX_ST_MATCH_ELEMENT Exception.
Below is my Simple Transformation, the calling method, and the XML snippet I am tying to deserialize.
-
<?sap.transform simple?>
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
<tt:root name="ROOT"/>
<tt:template>
<SndgInst>
<tt:value ref="ROOT"/>
</SndgInst>
</tt:template>
</tt:transform>
-
method PARSE_XML.
DATA:
sndginst(10) type c value ' ',
l_exception_error TYPE REF TO cx_st_error.
parse the xml content
TRY.
CLEAR: l_exception_error.
CALL TRANSFORMATION (i_st_name)
SOURCE XML i_xml_string
RESULT root = sndginst.
catch exception
CATCH: cx_st_error INTO l_exception_error.
ENDTRY.
endmethod.
-
<S2SCTScf:SndgInst ymlns:S2SCTScf="urn:S2SCTScf:xsd:$SCTScfBlkCredTrf">ZYDOFRP0</S2SCTScf:SndgInst>
-
I have tried adding a reference for the namespace 'S2SCTScf' but receive the same exception.
I think it must have something to do with the namespace prefix and I have tried several different versions of the Simple transformation, such as <S2SCTSCF:SndgInst> as my tag reference, to no avail.
The exception class does not provide a lot of useful information and since you cannot debug a Simple Transformation it is a guessing game.
Thanks in advance for your help.
Best Regards,
Mark Lengel
Edited by: Mark Lengel on Mar 31, 2009 11:32 AM
‎2009 Apr 07 2:35 PM
I've exactly the same problem.
My XML Input Stream contains Namespaces in the root element for e.g.
<Measurement xmlns="es.xxx.com" xmlns:ns2="http://www.w3.org/1999/xlink" xmlns:ns3="http://www.w3.org/1998/Math/MathML">
The Simple Transformation always raise an CX_ST_MATCH_ELEMENT Exception.
If i delete the xmlns declarations, the Element will be found and everything is o.k.
I've also tried to avoid this by adding the tt:extensible="deep-dynamic" attribute but it doesn't matter.
<tt:template>
<Measurement tt:extensible="deep-dynamic">
I use WebAS 6.40, ERP 2004.
I hope the Community could help us. Maybe it's bug in the XML Libraries.. etc..
Kind Regards
Chris
‎2009 Apr 07 2:38 PM
‎2009 Apr 08 9:30 AM
Unfortunately the threads above didn't contain any solution - has nobody found this problem? If you got an external xml file , you always have namespace declarations in the root tag.
any other ideas?
‎2020 Feb 24 11:07 AM
I am facing similar issue. Do you have any solution to avoid exception?
Regards
Sandeep K