3 Replies Latest reply on Oct 27, 2006 10:35 PM by Alejandro Guizar

    BPEL beta2 - special characters and XML

    wendong wang Newbie

      I try to assign some special characters as input value, for example

      <assign>
       <copy>
       <from expression="'-?/">='"/>
       <to variable="inputVariable"/>
       </copy>
       </assign>

      it works and I got
      -?/">=
      as the result.
      But when I replaces the ?>? with ?<?
      <assign>
       <copy>
       <from expression="'-?/"<='"/>
       <to variable=" inputVariable"/>
       </copy>
       </assign>

      I got the following error message:

      AxisFault
      faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
      faultSubcode:
      faultString: The content of elements must consist of well-formed character data
      or markup.
      faultActor:
      faultNode:
      faultDetail:
      {http://xml.apache.org/axis/}stackTrace: org.xml.sax.SAXParseException:
      The content of elements must consist of well-formed character data or markup.

      So my first question is how to assign ?<? in an input.

      Looks like it takes ?<? as starting a markup, my second question is how to assign XML as an input value.

      For example, I need to assign this as an input:
      <?xml version="1.0" encoding="UTF-8"?><Sample>TEST</Sample>

      I try
      <assign>
       <copy>
       <from expression="concat(
       '<?xml version="1.0" encoding="UTF-8"?>',
       '<Sample>TEST</Sample>')"/>
       <to variable=" inputVariable"/>
       </copy>
       </assign>

      But I got error message:
      AxisFault
      faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
      faultSubcode:
      faultString: The processing instruction target matching "[xX][mM][lL]"
      ; is not allowed.
      faultActor:
      faultNode:
      faultDetail:
      {http://xml.apache.org/axis/}stackTrace: org.xml.sax.SAXParseException:
      The processing instruction target matching "[xX][mM][lL]" is not allow
      ed.

      Please shed some lights on this. Thanks in advance.


        • 1. Re: BPEL beta2 - special characters and XML
          Alejandro Guizar Master

          The left angle bracket is illegal in attribute values. Use &lt; to escape it.

          Section 2.4, 2.4 Character Data and Markup of the XML 1.0 specification discusses this in detail.

          • 2. Re: BPEL beta2 - special characters and XML
            wendong wang Newbie

            Alex, I did use escaped strings "&quot;", "&gt;" and "&lt;" for the double-quote character ("), the right angle bracket (>) and the left angle bracket (<), respectively, in my testing. I don't know why they are changed to their literal form, even I Previewed them to make sure they were escaped strings before Submit. (I checked the 3 boxes to disable HTML, BBCode and Smilies, but on left side, the Options always show them ON)

            Here I re-submit again:
            ----------------------------------------------
            I try to assign some special characters as input value, for example

             <assign>
             <copy>
             <from expression="'-?/&quot;&gt;='"/>
             <to variable="inputVariable"/>
             </copy>
             </assign>
            

            it works and I got -?/">= as the result.
            But when I replaces the "&gt;" (escaped string) with "&lt;" (escaped string)
             <assign>
             <copy>
             <from expression="'-?/&quot;&lt;='"/>
             <to variable=" inputVariable"/>
             </copy>
             </assign>
            

            I got the following error message:

            AxisFault
            faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
            faultSubcode:
            faultString: The content of elements must consist of well-formed character data
            or markup.
            faultActor:
            faultNode:
            faultDetail:
            {http://xml.apache.org/axis/}stackTrace: org.xml.sax.SAXParseException:
            The content of elements must consist of well-formed character data or markup.

            So my first question is how to assign "&lt;" (escaped string) in an input.

            Looks like it takes "&lt;" (escaped string) as starting a markup, my second question is how to assign XML as an input value.

            For example, I need to assign this as an input:
            <?xml version="1.0" encoding="UTF-8"?><Sample>TEST</Sample>
            

            I try
             <assign>
             <copy>
             <from expression="concat(
             '&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;',
             '&lt;Sample&gt;TEST&lt;/Sample&gt;')"/>
             <to variable=" inputVariable"/>
             </copy>
             </assign>
            

            But I got error message:

            AxisFault
            faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
            faultSubcode:
            faultString: The processing instruction target matching &quot;[xX][mM][lL]&quot
            ; is not allowed.
            faultActor:
            faultNode:
            faultDetail:
            {http://xml.apache.org/axis/}stackTrace: org.xml.sax.SAXParseException:
            The processing instruction target matching &quot;[xX][mM][lL]&quot; is not allow
            ed.

            Please shed some lights on this. Thanks in advance.


            • 3. Re: BPEL beta2 - special characters and XML
              Alejandro Guizar Master

              Now I see the problem. The XML parser reads the escaped left angle bracket into the character itself and writes it literally to the SOAP message, thus producing ill-formed markup.
              Try escaping the escape sequence so that it appears literally in the resulting SOAP message:
              &amp;lt;