Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Transformation XML Output Attributes

Former Member
0 Likes
1,609

Hi Experts,

I have been searching through the forum but could not find any answer to my issue.

I'm using simple transformation and using a XString variable as result I get the  <?xml version="1.0" encoding="UTF-8"?> but I still need the .. standalone="yes"?>

I have seen some ways to do it using XSLT Transformation, but as I am using a simple one, tried but it does not work.
Thanks in advance.

Hi Experts,

I have been searching through the forum but could not find any answer to my issue.

I'm using simple transformation and using a XString variable as result I get the  <?xml version="1.0" encoding="UTF-8"?> but I still need the .. standalone="yes"?>

I have seen some ways to do it using XSLT Transformation, but as I am using a simple one, tried but it does not work.
Thanks in advance.

6 REPLIES 6
Read only

Former Member
0 Likes
1,169

Hi Francisco, What is your exact requirement?

Raju

Read only

0 Likes
1,169

My requirement is that instead of <?xml version="1.0" encoding="utf-8" ?>  I want the output to be

<?xml version="1.0" encoding="utf-8" standalone="yes"?>

-

Read only

Former Member
0 Likes
1,169

Did you solved your problem?

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,169

The easiest is to copy the ID transformation, add <xsl:output standalone = "yes"/> (to put right after xsl:transform start tag) and call this transformation for transforming the xml result obtained from your simple transformation.

Read only

0 Likes
1,169

You mean, add like this?

<?sap.transform simple?>

<?xml standalone="yes"?> // here? unfortunately, it's not works

<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">

  <tt:root name="TEXT"/>

  <tt:template>

    <text>

      <tt:attribute name="attr" value-ref="TEXT" />

      <tt:value ref="TEXT"/>

    </text>

  </tt:template>

</tt:transform>

Read only

0 Likes
1,169

It's not what I said.

1) Duplicate transformation ID into transformation ZID_STANDALONE_YES, and add <xsl:output standalone = "yes"/> (to put right after xsl:transform start tag)

2) After CALL TRANSFORMATION zsimpletransfo SOURCE ... RESULT XML xstring, add a line : CALL TRANSFORMATION zid_standalone_yes SOURCE XML xstring RESULT XML xstring.