<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Simple Transformation: Problems with encoding conversion (angle brackets) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation-problems-with-encoding-conversion-angle-brackets/m-p/12123159#M1974424</link>
    <description>&lt;P&gt;&lt;A href="https://answers.sap.com/users/226018/patricksteffens.html"&gt;Patrick Steffens&lt;/A&gt; Why is it a problem that a text with character &amp;gt; is seritalized into &amp;amp; gt; ? (by the way it's not related to the question which was about including an XML fragment in an XML element) That's how XML works: the deserialization will interpret &amp;amp; gt; as the character &amp;gt;. Same thing for &amp;amp; which is serialized into &amp;amp; amp;. Do you have an example to describe your problem? Or is it just because you don't "like" it?&lt;/P&gt;</description>
    <pubDate>Tue, 03 Dec 2019 12:10:51 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2019-12-03T12:10:51Z</dc:date>
    <item>
      <title>Simple Transformation: Problems with encoding conversion (angle brackets)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation-problems-with-encoding-conversion-angle-brackets/m-p/12123154#M1974419</link>
      <description>&lt;P&gt;I use ST to create an XML file from ABAP. The transformation works finde except for one tiny, yet crucial part.&lt;/P&gt;
  &lt;P&gt;Here's what the XML should look like in the end:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;Paket&amp;gt;
    &amp;lt;Metadaten&amp;gt;
        &amp;lt;DOKNR&amp;gt;N1-QCPRT-000231&amp;lt;/DOKNR&amp;gt;&amp;lt;DOKAR&amp;gt;DOC&amp;lt;/DOKAR&amp;gt;&amp;lt;DOKVR&amp;gt;-&amp;lt;/DOKVR&amp;gt;&amp;lt;DOKTL&amp;gt;000&amp;lt;/DOKTL&amp;gt;&amp;lt;WFRelevant&amp;gt;J&amp;lt;/WFRelevant&amp;gt;
    &amp;lt;/Metadaten&amp;gt;
&amp;lt;/Paket&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;The tags in line 4 have dynamic names, depending on the metadata parameters read by the program. Since ST is not built for handling such dynamic stuff, I create this line manually in ABAP by writing it into a string variable (PAKET.METADATEN) and use it in my transformation:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;&amp;lt;?sap.transform simple?&amp;gt;
&amp;lt;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"&amp;gt;
  &amp;lt;tt:root name="ROOT" type="?"/&amp;gt;
  &amp;lt;tt:root name="PAKET" type="ddic:ZPD_S_XML_PAKET_ROOT"/&amp;gt;
  &amp;lt;tt:template&amp;gt;
    &amp;lt;Paket&amp;gt;
      &amp;lt;tt:serialize&amp;gt;
        &amp;lt;Metadaten&amp;gt;&amp;lt;tt:value ref=".PAKET.METADATEN"/&amp;gt;&amp;lt;/Metadaten&amp;gt;
      &amp;lt;/tt:serialize&amp;gt;
    &amp;lt;/Paket&amp;gt;
  &amp;lt;/tt:template&amp;gt;
&amp;lt;/tt:transform&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;I transform it writing the output into an xstring variable (to get an UTF-8 XML). The transformation now interprets the angle brackets in the string as '&amp;amp; lt;' for '&amp;lt;' and '&amp;amp; gt;' for '&amp;gt;' (ignore the whitespace ;-)) which leads to the following output XML (in bytes, since this editor here is able to interpret it correctly:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d227574662d38223f3e0a3c50616b65743e0a093c4d657461646174656e3e266c743b444f4b4e522667743b4e312d51435052542d303030323331266c743b2f444f4b4e522667743b266c743b444f4b41522667743b444f43266c743b2f444f4b41522667743b266c743b444f4b56522667743b2d266c743b2f444f4b56522667743b266c743b444f4b544c2667743b303030266c743b2f444f4b544c2667743b3c2f4d657461646174656e3e0a3c2f50616b65743e&amp;lt;br&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;I'm working on a unicode system and thus the string value is represented in unicode. The output must be a UTF-8 xml file.&lt;/P&gt;
  &lt;P&gt;So the basic question is: How can I either realize such dynamic tag names without filling a string variable or have ST interpret the string properly, so that the angle brackets are shown in the output?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2019 11:31:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation-problems-with-encoding-conversion-angle-brackets/m-p/12123154#M1974419</guid>
      <dc:creator>patricksteffens</dc:creator>
      <dc:date>2019-11-29T11:31:14Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Transformation: Problems with encoding conversion (angle brackets)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation-problems-with-encoding-conversion-angle-brackets/m-p/12123155#M1974420</link>
      <description>&lt;P&gt;Check out &lt;STRONG&gt;&lt;/STRONG&gt;&lt;A href="https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abenabap_xslt_asxml_fragment.htm"&gt;XML Fragments&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Demo program for ST = &lt;STRONG&gt;DEMO_ST_XSDANY&lt;/STRONG&gt; - method &lt;STRONG&gt;prepare_fragment&lt;/STRONG&gt; is creating XML string which is later inserted in transformation to result XML.&lt;/P&gt;&lt;P&gt;By the way XML Fragments works in XSL Transformation too (not only in Simple Transformations).&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2019 12:36:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation-problems-with-encoding-conversion-angle-brackets/m-p/12123155#M1974420</guid>
      <dc:creator>Tomas_Buryanek</dc:creator>
      <dc:date>2019-11-29T12:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Transformation: Problems with encoding conversion (angle brackets)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation-problems-with-encoding-conversion-angle-brackets/m-p/12123156#M1974421</link>
      <description>&lt;P&gt;Hi Tomas,&lt;/P&gt;&lt;P&gt;thanks a lot for this hint. This solved the initial problem of broken tags &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; However, &amp;lt; and &amp;gt; within such nodes (e.g. arrow symbols in description texts) are still translated into &lt;EM&gt;&amp;amp; lt ;&lt;/EM&gt; and &lt;EM&gt;&amp;amp; gt ;&lt;/EM&gt; (without whitespace) .  Do you know why this happens?&lt;/P&gt;&lt;P&gt;Best&lt;BR /&gt;Patrick&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 09:57:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation-problems-with-encoding-conversion-angle-brackets/m-p/12123156#M1974421</guid>
      <dc:creator>patricksteffens</dc:creator>
      <dc:date>2019-12-03T09:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Transformation: Problems with encoding conversion (angle brackets)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation-problems-with-encoding-conversion-angle-brackets/m-p/12123157#M1974422</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;patricksteffens&lt;/SPAN&gt; It looks like you need to &lt;A href="https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenescape_functions.htm"&gt;escape&lt;/A&gt; the values in your XML string (fragment) before transformation.&lt;/P&gt;&lt;P&gt;For example you have a value "two &amp;gt; one" in tag &amp;lt;value&amp;gt;. After escaping the complete string would look like - EDIT: without spaces after ampresand, sap.com forum is unescaping escaped value &amp;gt; &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;value&amp;gt;two &amp;amp; gt ; one&amp;lt;/value&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Dec 2019 10:05:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation-problems-with-encoding-conversion-angle-brackets/m-p/12123157#M1974422</guid>
      <dc:creator>Tomas_Buryanek</dc:creator>
      <dc:date>2019-12-03T10:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Transformation: Problems with encoding conversion (angle brackets)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation-problems-with-encoding-conversion-angle-brackets/m-p/12123158#M1974423</link>
      <description>&lt;P&gt;I replaced all &amp;lt; by &lt;EM&gt;&amp;amp; lt ;&lt;/EM&gt; and all &amp;gt; by &lt;EM&gt;&amp;amp; gt ; &lt;/EM&gt;(without whitespace) before the id transformation.&lt;/P&gt;&lt;P&gt;In the output XML, they are not translated back into &amp;lt; and &amp;gt;.Even worse: The &amp;amp; is interpreted as &lt;EM&gt;&amp;amp; amp ;&lt;/EM&gt; which makes somewhat sense to me.&lt;/P&gt;&lt;P&gt;Or did I get you wrong?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 11:26:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation-problems-with-encoding-conversion-angle-brackets/m-p/12123158#M1974423</guid>
      <dc:creator>patricksteffens</dc:creator>
      <dc:date>2019-12-03T11:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Transformation: Problems with encoding conversion (angle brackets)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation-problems-with-encoding-conversion-angle-brackets/m-p/12123159#M1974424</link>
      <description>&lt;P&gt;&lt;A href="https://answers.sap.com/users/226018/patricksteffens.html"&gt;Patrick Steffens&lt;/A&gt; Why is it a problem that a text with character &amp;gt; is seritalized into &amp;amp; gt; ? (by the way it's not related to the question which was about including an XML fragment in an XML element) That's how XML works: the deserialization will interpret &amp;amp; gt; as the character &amp;gt;. Same thing for &amp;amp; which is serialized into &amp;amp; amp;. Do you have an example to describe your problem? Or is it just because you don't "like" it?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 12:10:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation-problems-with-encoding-conversion-angle-brackets/m-p/12123159#M1974424</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-12-03T12:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Transformation: Problems with encoding conversion (angle brackets)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation-problems-with-encoding-conversion-angle-brackets/m-p/12123160#M1974425</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt; : We encountered problems where description texts are not translated consistently. E.g. the text "ä&amp;lt;" would be translated into "ä&amp;amp; lt ;" (without whitespace) which is a problem for our software parsing the XML (it fails reading the 'ä' symbol). Thus I would like to have either all or no symbol transformed. So either I would expect all symbols to be translated or none.&lt;/P&gt;&lt;P&gt;Is there an explanation for this observation?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 16:24:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation-problems-with-encoding-conversion-angle-brackets/m-p/12123160#M1974425</guid>
      <dc:creator>patricksteffens</dc:creator>
      <dc:date>2020-01-06T16:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Transformation: Problems with encoding conversion (angle brackets)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation-problems-with-encoding-conversion-angle-brackets/m-p/12123161#M1974426</link>
      <description>&lt;P&gt;By the way, I tried to escape the tag containing these symbols via CDATA but this did not have an effect.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 16:26:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation-problems-with-encoding-conversion-angle-brackets/m-p/12123161#M1974426</guid>
      <dc:creator>patricksteffens</dc:creator>
      <dc:date>2020-01-06T16:26:42Z</dc:date>
    </item>
  </channel>
</rss>

