Skip to Content
avatar image
Former Member

Problem with &

Hi All

I receive a string with a & from a 3rd Party. This seems to crash the mapping on XI.

The type is currently defined as a 'String', and works perfectly for all strings - just a problem when the string contains a '&'.

Thanks in advance

Clinton

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Jan 08, 2007 at 12:52 PM

    Hi,

    what is the problem?

    roberti

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi

      The following XML is what I get from the 3rd Party.

      =============================================

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

      - <!-- Request Message Mapping

      -->

      - http://lonmin.co.za/MetallurgicalApprovalProcess" xmlns:xsd=" http://www.w3.org/2001/XMLSchema" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xmlns:soap=" http://schemas.xmlsoap.org/soap/envelope/">

      - <Process xmlns="">

      <ProcessID>0</ProcessID>

      <ProcessName>data</ProcessName>

      <DataSetCategory>data</DataSetCategory>

      <DataSetLogTime>data</DataSetLogTime>

      <CurrentStageName>data</CurrentStageName>

      <ViewURL><b>http://addres/PARS1/NoMenu.aspx?tab=7&procid=0&iindex=0</b></ViewURL>

      <ClearFlag>true</ClearFlag>

      </Process>

      </MT_Metallurgical_Approval_Prcess>

      ============================================

      The ViewURL that I receive crashes the mapping. If I change the ViewURL string to <ViewURL><b>http://addres/PARS1/NoMenu.aspx?tab=7procid=0iindex=0</b></ViewURL> this is the string without the '&'.

      Hope this makes sense

      Thanks

      Clinton

  • Jan 08, 2007 at 01:08 PM

    Hi Clinton,

    the received XML is not any longer well formed if including a "&". You need a CDATA element like:

    <![CDATA[&]]>

    , to pass it through a XML parser. For that reason you can put an not parsing ABAP mapping in front of the interface mapping, which will substitute the "&". Use FM ECATT_CONV_XSTRING_TO_STRING to have string, REPLACE the '&' and use FM ECATT_CONV_STRING_TO_XSTRING to have a XSTRING for the result. If your mapping is XSL you can use attribute <i>disable-output-escaping="yes"</i> of "<i>value-of</i>" to get the CDATA value.

    Regards,

    Udo

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 08, 2007 at 01:20 PM

    This was discussed already in this thread:

    ampersand-in-xml-mapping-error

    Regards

    Stefan

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 11, 2007 at 06:04 AM

    Good help from fellow XI'ers

    Add comment
    10|10000 characters needed characters exceeded