<?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: how to encode values properly when using DOM in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-encode-values-properly-when-using-dom/m-p/801100#M40883</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to save others the search, who might have a similar problem: There is a function module called SDIXML_DATA_TO_DOM. This function generates a DOM node that contains the correctly represented value. It can use any type that you hand over.&lt;/P&gt;&lt;P&gt;To this node one can then add any required attributes and finally plug it into one's DOM tree.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If one needs to 'escape' a value and then insert it as value of an attribute - then doing the following is possible: &lt;/P&gt;&lt;P&gt;- use SDIXML_DATA_TO_DOM on your value&lt;/P&gt;&lt;P&gt;- extract the text content of generated XML node&lt;/P&gt;&lt;P&gt;- use this value (which now has the proper, XML-converted representation of your value) to create your attribute with the IXML object library.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This approach produces some overhead of course, because a useless DOM Node gets created and discarded again, but that should be manageable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There seems to be no object-oriented counterpart for this function module. There are other SDIXML* functions for which this also the case (e.g. schema generation from DDIC), so looking at this functions might be worthwile.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Oct 2004 12:43:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2004-10-14T12:43:09Z</dc:date>
    <item>
      <title>how to encode values properly when using DOM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-encode-values-properly-when-using-dom/m-p/801099#M40882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am facing a kind of tricky problem. I am using DOM in ABAP (with the IXML library) to generate and render XML trees. &lt;/P&gt;&lt;P&gt;Basically all of that works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that the DOM elements (namely attributes and text node) allow only for &amp;lt;b&amp;gt;STRING&amp;lt;/b&amp;gt;-typed arguments to set their value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is problematic, because I want to exchange data with other systems. For that I would use the encoding that SAP uses in the asXML format. In that format a Date for example is represented in the form YYYY-MM-DD (instead of the internal SAP format: YYYYMMDD) and a negativ number as -XXX (instead of the internal SAP format: XXX-). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to use an asXML-like value format, because that is based on international standards for expressing certain data types. But when using DOM I don't know how to convert a value into such a representation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought about converting ABAP data into asXML and then creating a fitting XSLT to circumvent the necessity of "manually" converting values into the correct format, but the data has a linear structure which would require complicated, crude and inperformant XSLT code to convert into a hierarchy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the basic question is: how can I render a non-character-like value (e.g. a Date) into a proper asXML-like string representation (YYYY-MM-DD)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried a lot and also read all documentation on this that I could find. Does anybody have a clue on this? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much.&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Aug 2004 17:55:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-encode-values-properly-when-using-dom/m-p/801099#M40882</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2004-08-19T17:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: how to encode values properly when using DOM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-encode-values-properly-when-using-dom/m-p/801100#M40883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to save others the search, who might have a similar problem: There is a function module called SDIXML_DATA_TO_DOM. This function generates a DOM node that contains the correctly represented value. It can use any type that you hand over.&lt;/P&gt;&lt;P&gt;To this node one can then add any required attributes and finally plug it into one's DOM tree.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If one needs to 'escape' a value and then insert it as value of an attribute - then doing the following is possible: &lt;/P&gt;&lt;P&gt;- use SDIXML_DATA_TO_DOM on your value&lt;/P&gt;&lt;P&gt;- extract the text content of generated XML node&lt;/P&gt;&lt;P&gt;- use this value (which now has the proper, XML-converted representation of your value) to create your attribute with the IXML object library.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This approach produces some overhead of course, because a useless DOM Node gets created and discarded again, but that should be manageable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There seems to be no object-oriented counterpart for this function module. There are other SDIXML* functions for which this also the case (e.g. schema generation from DDIC), so looking at this functions might be worthwile.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Oct 2004 12:43:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-encode-values-properly-when-using-dom/m-p/801100#M40883</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2004-10-14T12:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to encode values properly when using DOM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-encode-values-properly-when-using-dom/m-p/801101#M40884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   I'm now start working on a funcion to build a XML file from values returned from a function module. Can you help me in this? I have SAP version 4.6C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;  Ana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2005 16:29:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-encode-values-properly-when-using-dom/m-p/801101#M40884</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-01T16:29:35Z</dc:date>
    </item>
  </channel>
</rss>

