3 Replies Latest reply: Nov 2, 2012 1:55 AM by Peter van Nes at The Future Group RSS

    How to escape XML in BPEL?

    Peter van Nes at The Future Group
      I have a part of a outputmessage in an element HTML of xsd:any. This element contains HTML which i have to transform to escaped XML.
      Therefore i created the following embedded java code.

      String htmlContent = ((oracle.xml.parser.v2.XMLElement)getVariableData("l_GetBericht_Output","reply","/ns5:GetBerichtResponse/ns14:Bericht/ns14:HTML")).getFirstChild().getNodeValue() ;
      htmlContent.replaceAll("<","&lt;") ;
      htmlContent.replaceAll(">","&gt;") ;
      setVariableData("TestHTMLContent",htmlContent);

      Message in l_GetBericht_Output starts with;

      <l_GetBericht_Output>
      <part name="reply">
      <sbtn:GetBerichtResponse>
      <ns3:Bericht>
      <ns3:Onderwerp>sdjasldjalsda</ns3:Onderwerp>
      <ns3:Tekst/>
      <ns3:HTML>
      <HTML>
      <div>
      <p>Data</p>
      <p>
      <p>
      de heer ...


      The result of the selection in BPEL variable TestHTMLContent is empty though.
      Anyone any thoughts ?

      Is there a better way to transform XML to escaped XML ?
      Why is my selection null ?

      Cheers,
      Peter