Skip to Content
author's profile photo Former Member
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 a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2007 at 12:52 PM

    Hi,

    what is the problem?

    roberti

    Add a 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

  • Posted on 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 a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 08, 2007 at 01:20 PM

    This was discussed already in this thread:

    ampersand-''-in-xml---mapping-error

    Regards

    Stefan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 06:04 AM

    Good help from fellow XI'ers

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.