2016 Jun 08 10:35 PM
Hi all,
I would like change the following simple transformation such that the underlined area is dynamic:
<?sap.transform simple?>
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
<tt:root name="JS_COMMAND_ID"/>
<tt:template>
<Jetstream xmlns=http://Jetstream.TersoSolutions.com/v1.0/CommandResponse>
I have created a parameter that I am able to successfully pass into the transformation:
<tt:parameter name="VERS" kind="in" type="STRING"/>
I can see that this parameter contains the correct value in the debugger. However, when I try to use it as so:
<Jetstream xmlns="VERS">
I receive an element mismatch error. I have also tried "$VERS" with no success either.
Any suggestions?
2016 Jun 09 6:09 AM
Did you try <Jetstream><tt:attribute name="xmlns" value-ref="VERS"/> ?
Hi all,
I would like change the following simple transformation such that the underlined area is dynamic:
<?sap.transform simple?>
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
<tt:root name="JS_COMMAND_ID"/>
<tt:template>
<Jetstream xmlns=http://Jetstream.TersoSolutions.com/v1.0/CommandResponse>
I have created a parameter that I am able to successfully pass into the transformation:
<tt:parameter name="VERS" kind="in" type="STRING"/>
I can see that this parameter contains the correct value in the debugger. However, when I try to use it as so:
<Jetstream xmlns="VERS">
I receive an element mismatch error. I have also tried "$VERS" with no success either.
Any suggestions?
2016 Jun 09 6:09 AM
Did you try <Jetstream><tt:attribute name="xmlns" value-ref="VERS"/> ?
2016 Jun 09 5:14 PM
Sandra,
Thanks for your suggestion, however that approach results in an 'unknown root VERS' syntax error. I am now trying this:
While this passes syntax checking, I receive a "Error during access to the ref node "JSVERNUM'. The ref node is not defined or does not have the necessary type' error upon execution. (I realize I have a redundant variable in there, but when I try using the variable directly I get an 'unknown ROOT' message.) As mentioned previously, the value of the input parameter is correct, and I can see that the value of the variable is being assigned correctly. Now it insists that I use a ROOT defined variable in the tt:attribute statement, but flags an error if I try to set the value of this data ROOT.
2016 Jun 09 7:57 PM
Indeed, it seems the only solution is to define it as a root. Is that a problem?
This code works:
DATA xml_string TYPE string.
CALL TRANSFORMATION ztestSOURCE var_xmlns = 'urn:test'RESULT XML xml_string.
The transformation :
<?sap.transform simple?>
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
<tt:root name="VAR_XMLNS"/>
<tt:template>
<Jetstream>
<tt:attribute name="xmlns" value-ref="VAR_XMLNS"/>
value
</Jetsream>
</tt:template>
</tt:transform>The result (in xml_string) :
<?xml version="1.0" encoding="utf-16"?>
<Jetstream xmlns="urn:test">## value## </Jetstream>
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |