XML CDATA

Hi,
I am trying to add a CDATA section to my XML.  The payload looks ok, but the actual output received by the legacy system (MQ - using JMS adapter) modifies the < and > to string tags &lt and &gt.  Is there a way to prevent the string tag conversion?  An existing module?  Defining a different element type in the data type?  Anything?  Please see the example below:
Payload
<ItemIdentification><![CDATA[<Data><ShipMethod>49</ShipMethod><ArchiveDirectory>TBA</ArchiveDirectory><OrderNumber>30026752</OrderNumber><LineItemNumber>01</LineItemNumber></Data>]]></ItemIdentification>
File received by MQ from XI
<ItemIdentification>&lt;![CDATA[&lt;Data&gt;&lt;ShipMethod&gt;49&lt;/ShipMethod&gt;&lt;ArchiveDirectory&gt;TBA&lt;/ArchiveDirectory&gt;&lt;OrderNumber&gt;30026752&lt;/OrderNumber&gt;&lt;LineItemNumber&gt;01&lt;/LineItemNumber&gt;&lt;/Data&gt;]]&gt;</ItemIdentification>
Thanks,
Lisa Adair

Hi Lisa,
A question for you, rather than an answer (sorry): how did you add CDATA sections in the XML file via ABAP? I know of the method CREATE_CDATA_SECTION but don't know how to use it. Would be great if you could offer some help/code snapshot on this.
Best Regards
Viv

Similar Messages

  • Problem: Storing binary data in Xml Cdata section

    The objective : Tranport image using xml
    1. I convert the image to input stream.
    2. store it in an array.
    3. encode the string using Base64 library and get a string
    4.then i store it in xml CDATA section.
    the code snippet is
    public class ImgToXml01 {
         public static void main(String[] args) throws IOException
              File inputFile = new File("C:\\Arup\\ImgXml\\read\\Sample.jpg");
              FileInputStream in = new FileInputStream(inputFile);
              String str="";
              int c;
              while ((c = in.read()) != -1) {
              str+= ""+c;
              String val = util.Base64.encode(str);
              System.out.println(""+val);
              OutputStream fout = new FileOutputStream("img.xml");
              OutputStreamWriter out = new OutputStreamWriter(fout);
              out.write("<?xml version = \"1.0\" encoding = \"ISO-8859-1\"?>\r\n");
              out.write("<Image>\r\n");
              out.write("[CDATA["+val+"]]");
              //out.write("]]>");
              out.write("</image>\r\n");
              out.close();
    When i retrieve it i write the code:
    import org.xmldb.api.base.*;
    import org.xmldb.api.modules.*;
    import org.xmldb.api.*;
    import org.w3c.dom.*;
    import java.io.*;
    import org.xml.sax.SAXException;
    import oracle.xml.parser.v2.*;
    public class CdataToImage01 {
         public static void main(String[] args) //throws IOException
         try{
         String uri="c:\\Arup\\ImgXml\\img1.xml";
         String data="";      
         File file = new File(uri);
         FileInputStream fis = new FileInputStream(file);
         BufferedInputStream in = new BufferedInputStream(fis);      
         DOMParser parser = new DOMParser();
         parser.parse(in);      
         Document doc = parser.getDocument();
         Node r = doc.getElementsByTagName("Image").item(0);          
         NodeList kids = r.getChildNodes();
         if ( kids != null )     {
              for ( int i = 0; i < kids.getLength(); i++ ) {
                   if ( (kids.item(i).getNodeType() == Node.TEXT_NODE) ||
                             (kids.item(i).getNodeType() == Node.CDATA_SECTION_NODE)) {
                             data=kids.item(i).getNodeValue();
              String data1 = util.Base64.decode(data);
              File outputFile = new File("Sample.jpg");
              FileOutputStream out = new FileOutputStream(outputFile);      
              byte[] buff = data1.getBytes();
              InputStream inn = new ByteArrayInputStream(buff);
              int c;
              System.out.println(buff.length);
              while ((c = inn.read()) != -1) {
              out.write(c);
              inn.close();
              out.close();
         catch (SAXException e) {
              System.err.println(e);
              e.printStackTrace();
         catch (Exception ex){
              System.err.println("Exception occured " + ex.getMessage());
              ex.printStackTrace();
    But i am not getting the appropriate result .I get a corrupted image.
    FROM
    ARUP GHOSH

    String str="";
    int c;
    while ((c = in.read()) != -1) {
    str+= ""+c;
    }Your problem is here.
    Let's suppose you just have a trivial 3-byte file containing the bytes 27, 55, and 126. Your program will convert that into the string "2755126". Then you base-64 encode it, etc etc, then you base-64 decode it and (hopefully) produce the same string "2755126". Converting this string to bytes and writing it to a file produces a 7-byte file containing the bytes 50, 55, 53, 53, 49, 50, and 54. Not the same at all. You could prove this to yourself by putting in some debugging statements.
    I don't know how to suggest a fix because it looks to me as if your base-64 utility takes a String as its input. It should take an array of bytes, or an InputStream.
    PC&#178;

  • How to pass a xml CDATA in string element when OSB calling a webservice?

    How to pass a xml CDATA in string element when OSB calling a webservice?
    I have a business service (biz) that route to operation of a webservice.
    A example of request to this webservice legacy:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:eg="example">
    <soapenv:Header/>
    <soapenv:Body>
    <ex:execute>
    <ex:arg><![CDATA[<searchCustomerByDocumentNumber>
    <documentNumber>12345678909</documentNumber>
    </searchCustomerByDocumentNumber>]]></ex:arg>
    </ex:execute>
    </soapenv:Body>
    </soapenv:Envelope>
    the type of ex:arg is a string.
    How to pass this CDATA structure to webservice in OSB?

    Steps to solve this problem:
    1. Create a XML Schema. E.g.:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
         elementFormDefault="unqualified">
         <xs:complexType name="searchCustomerByDocumentNumber">
              <xs:sequence>
                   <xs:element name="documentNumber" minOccurs="0">
                        <xs:annotation>
                             <xs:documentation>
                             </xs:documentation>
                        </xs:annotation>
                        <xs:simpleType>
                             <xs:restriction base="xs:string" />
                        </xs:simpleType>
                   </xs:element>
         </xs:sequence>
         </xs:complexType>
         <xs:element name="searchCustomerByDocumentNumber" type="searchCustomerByDocumentNumber"></xs:element>
    </xs:schema>
    With this XSD, the XML can be generate:
    <?xml version="1.0" encoding="UTF-8"?>
    <searchCustomerByDocumentNumber xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="searchCustomerByDocumentNumber.xsd">
    <documentNumber>documentNumber</documentNumber>
    </searchCustomerByDocumentNumber>
    2. Create a XQuery to create a searchCustomerByDocumentNumber ComplexType. E.g.:
    (:: pragma bea:global-element-return element="searchCustomerByDocumentNumber" location="searchCustomerByDocumentNumber.xsd" ::)
    declare namespace xf = "http://tempuri.org/NovoSia/CreateSearchCustomerByDocumentNumber/";
    declare function xf:CreateSearchCustomerByDocumentNumber($documentNumber as xs:string)
    as element(searchCustomerByDocumentNumber) {
    <searchCustomerByDocumentNumber>
    <documentNumber>{ $documentNumber }</documentNumber>
    </searchCustomerByDocumentNumber>
    declare variable $documentNumber as xs:string external;
    xf:CreateSearchCustomerByDocumentNumber($documentNumber)
    3. In your stage in pipeline proxy add a assign calling the XQuery created passing the document number of your payload.
    Assign to a variable (e.g.: called searchCustomerByDocumentNumberRequest)
    4. Create another XQuery Transformation (XQ) to create a request to the webservice legacy. E.g.:
    <ex:arg>{fn-bea:serialize($searchCustomerByDocumentNumberRequest)}</ex:arg>
    For more information about xquery serialize function:
    41.2.6 fn-bea:serialize()
    You can use the fn-bea:serialize() function if you need to represent an XML document as a string instead of as an XML element. For example, you may want to exchange an XML document through an EJB interface and the EJB method takes String as argument. The function has the following signature:
    fn-bea:serialize($input as item()) as xs:string
    Source: http://docs.oracle.com/cd/E14571_01/doc.1111/e15867/xquery.htm

  • How to receive a xml CDATA in string element when OSB calling a webservice?

    How to receive a xml CDATA in string element when OSB calling a webservice?
    I have a business service (biz) that route to operation of a webservice.
    A example of response to this webservice legacy:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:eg="example">
    <soapenv:Header/>
    <soapenv:Body>
    <ex:executeResponse>
    <ex:arg><![CDATA[<searchCustomerByDocumentNumberResponse>
    <name>John John</name>
    </searchCustomerByDocumentNumberResponse>]]></ex:arg>
    </ex:executeResponse>
    </soapenv:Body>
    </soapenv:Envelope>
    the type of ex:arg is a string.
    How to receive this CDATA structure to webservice in OSB?

    Similiar to the answer How to pass a xml CDATA in string element when OSB calling a webservice?
    Use the xquery function fn-bea:inlinedXML rather than fn-ben:serialize
    Steps to solve this problem:
    1. Create a XML Schema. E.g.:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="unqualified">
    <xs:complexType name="searchCustomerByDocumentNumberResponse">
    <xs:sequence>
    <xs:element name="name" minOccurs="0">
    <xs:annotation>
    <xs:documentation>
    </xs:documentation>
    </xs:annotation>
    <xs:simpleType>
    <xs:restriction base="xs:string" />
    </xs:simpleType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    <xs:element name="searchCustomerByDocumentNumberResponse" type="searchCustomerByDocumentNumberResponse"></xs:element>
    </xs:schema>
    2. Create a XQuery to create a searchCustomerByDocumentNumber ComplexType. E.g.:
    3. Create a XQuery Transformation (XQ) to get the CDATA response to the webservice legacy. E.g.:
    declare namespace ns0 = "novosiaws";
    declare function xf:getReponse($searchCustomerByDocumentNumberResponse as element(ns0:searchCustomerByDocumentNumberResponse))
    as element(searchCustomerByDocumentNumberResponse) {
    fn-bea:inlinedXML($searchCustomerByDocumentNumberResponse/ns0:arg)
    For more information about xquery function:
    fn-bea:inlinedXML
    The fn-bea:inlinedXML() function parses textual XML and returns an instance of the XQuery 1.0 Data Model.
    The function has the following signature:
    fn-bea:inlinedXML($text as xs:string) as node()*
    where $text is the textual XML to parse.
    Examples:
    fn-bea:inlinedXML(“<e>text</e>”) returns element “e”.
    fn-bea:inlinedXML(“<?xml version=”1.0”><e>text</e>”) returns a document with root element “e”.
    Source: http://docs.oracle.com/cd/E13162_01/odsi/docs10gr3/xquery/extensions.html

  • Embedding HTML in XML CDATA and encoding issues

    Hi all,
    I'm embedding HTML code in a CDATA section. My problem is that, depending on the document, the HTML can be encoded in many formats. I borrowed a piece of code that sniffs that format so i can create String in the "right" encoding (or at least the one that was guessed).
    - If I directly injected those in the CDATA section, i guess they'd be encoded in UTF-8 and some character would be misinterpreted?
    - What if i would transcode the HTML from the sniffed format to utf-8?
    -Are there any issues woth doing this?
    Sorry if this is a dumb question but I'm quite new to that kind of encoding issues.
    BTW i'm using DOM.
    Thanks
    lexo

    I don't know if it's a dumb question. I just don't understand it at all. Encoding issues only arise when you write data from a Java program to an external location, or when you read data from an external location into a Java program. And none of the activities you mentioned there have anything to do with that.
    When you write your XML to an external file, or wherever you write it to, it gets encoded at that moment. The whole thing. Elements, attributes, CDATA sections, the whole thing. Doesn't matter what's in it, the whole thing gets encoded in whatever charset was chosen.
    Does that help?

  • How to handle xml CDATA string element when OSB calling a webservice

    Hi
    Right, I'm new to OSB so bear with me.
    The following is a response from am operation in a webservice.
    As you can see there is a CDATA string in "<m:return>" element. I want to transform the CDATA string to XML.
    I have searched the forum and found a couple of similar queries and tried following the answers and this is what I'm getting.
    Please advise as to where I have gone wrong and how I can correct it.
    <env:Body xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
         <m:ReservationCancelResponse xmlns:m="http://domain/jws">
              <m:return>
                   <![CDATA[<?xml version="1.0" encoding="UTF-8"?><ReservationCancelNegativeAck><MessageId>HGv2OWS6hq</MessageId><ReservationNum>1234</ReservationNum><CsrId></CsrId><ErrorCode>02</ErrorCode><ErrorMessage>Reservation '1234' does not exist.</ErrorMessage></ReservationCancelNegativeAck>]]>
              </m:return>
         </m:ReservationCancelResponse>
    </env:Body>
    In my response pipeline I have an Assign and Replace action.
    My Assign is:
    Expression: fn-bea:inlinedXML($body)
    Variable: reservationCancelReponse
    When I log $reservationCancelReponseI get... so this bit is OK.
    <ReservationCancelNegativeAck>
    <MessageId>HGv2OWS6hq</MessageId>
    <ReservationNum>1234</ReservationNum>
    <CsrId/>
    <ErrorCode>02</ErrorCode>
    <ErrorMessage>Reservation '1234' does not exist.</ErrorMessage>
    </ReservationCancelNegativeAck>
    My Replace
    XPath: executeResponse/executeReturn/text()
    In Variable: body
    Expression: responseTransform.xq (binding with $reservationCancelReponse)
    Replace Node Contents is checked
    When I test the operation using the proxy service I get the following:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Header/>
    <env:Body>
    <m:ReservationCancelResponse xmlns:m="http://com/ventyx/abws/jws">
    <m:return>
    &lt;?xml version="1.0" encoding="UTF-8"?>&lt;ReservationCancelNegativeAck>&lt;MessageId>HGv2OWS6hq&lt;/MessageId>&lt;ReservationNum>1234&lt;/ReservationNum>&lt;CsrId>&lt;/CsrId>&lt;ErrorCode>02&lt;/ErrorCode>&lt;ErrorMessage>Reservation &amp;apos;1234&amp;apos; does not exist.&lt;/ErrorMessage>&lt;/ReservationCancelNegativeAck>
    </m:return>
    </m:ReservationCancelResponse>
    </env:Body>
    </env:Envelope>
    The CDATA string hasn't been transformed.
    Please help. What I have I missed.
    Thanks in advance.
    MI

    OK
    I have made some amendments to the original process and made some progress but still isn't quite right.
    I have created a schema:
    <complexType name="ReservationCancelNegativeAckType">
         <sequence>
                   <element name="MessageId" minOccurs="0">
                        <annotation>
                             <documentation>
                             </documentation>
                        </annotation>
                        <simpleType>
                             <restriction base="string" />
                        </simpleType>
                   </element>
                   <element name="ReservationNum" minOccurs="0">
                        <annotation>
                             <documentation>
                             </documentation>
                        </annotation>
                        <simpleType>
                             <restriction base="string" />
                        </simpleType>
                   </element>
                   <element name="CsrID" minOccurs="0">
                        <annotation>
                             <documentation>
                             </documentation>
                        </annotation>
                        <simpleType>
                             <restriction base="string" />
                        </simpleType>
                   </element>
                   <element name="ErrorCode" minOccurs="0">
                        <annotation>
                             <documentation>
                             </documentation>
                        </annotation>
                        <simpleType>
                             <restriction base="string" />
                        </simpleType>
                   </element>
                   <element name="ErrorDescription" minOccurs="0">
                        <annotation>
                             <documentation>
                             </documentation>
                        </annotation>
                        <simpleType>
                             <restriction base="string" />
                        </simpleType>
                   </element>
         </sequence>
    </complexType>
    <element name="ReservationCancelNegativeAckType"
         type="tns:ReservationCancelNegativeAckType">
    </element>
    I have amended the earlier Assign action to use an XQ to extract the CDATA string into the schema
    My Assign is:
    Expression: responseToSchema.xq
    Variable: reservationCancelReponse
    When I log $reservationCancelReponse variable I get... so this bit is OK.
    <ReservationCancelNegativeAck>
    <MessageId>HGv2OWS6hq</MessageId>
    <ReservationNum>1234</ReservationNum>
    <CsrId/>
    <ErrorCode>02</ErrorCode>
    <ErrorMessage>Reservation '1234' does not exist.</ErrorMessage>
    </ReservationCancelNegativeAck>
    I have also changed my Replace, this time I am using an XQ which will map the schema to the XSD WSDL "ReservationCancelResponse"operation.
    XPath: .
    In Variable: body
    Expression: responseFromSchemaToService.xq (binding with $reservationCancelReponse)
    Replace Node Contents is checked
    XSD WSDL is:
    <xsd:element name="ReservationCancelResponse"
         type="tns:ReservationCancelResponseType">
    </xsd:element>
    <xsd:complexType name="ReservationCancelResponseType">
         <xsd:sequence>
              <xsd:element name="ResponseCode"
                   type="xsd:string">
              </xsd:element>
              <xsd:element name="ResponseDescription"
                   type="xsd:string">
              </xsd:element>
              <xsd:element name="MessageID" type="xsd:string">
              </xsd:element>
              <xsd:element name="ReservationNum" type="xsd:string">
              </xsd:element>
              <xsd:element name="CsrId" type="xsd:string">
              </xsd:element>
              <xsd:element name="ErrorCode" type="xsd:string"
                   minOccurs="0">
              </xsd:element>
              <xsd:element name="ErrorDescription" type="xsd:string" minOccurs="0"></xsd:element>
         </xsd:sequence>
    </xsd:complexType>
    This time the response is better but not right.
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Header xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"/>
    <env:Body xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <app:ReservationCancelResponse xmlns:app="http://www.example.org/AppointmentService/">
    <ResponseCode>0</ResponseCode>
    <ResponseDescription/>
    <MessageID/>
    <ReservationNum/>
    <CsrId/>
    </app:ReservationCancelResponse>
    </env:Body>
    </soapenv:Envelope>
    As you can see the tags are empty. (For info: The "ResponseCode" and "ResponseDescription" are constants)
    Where have I gone wrong?

  • Insert HTML Page into XML CDATA Tag

    Hi Guy
    I have a very big problem.
    I create a little web site and I use XSL + XML to produce output.Now I
    want to add a part of html page into xml tag to use a custom page section.
    But i find a problme,
    see the example :
    I use this xml :
    <resources>
    <html><![CDATA[<B>Hello World</B>]]></html>
    </resources>
    trasform xml with xsl page
    and my output into html browser is (&lt);B(&gt);Hello World(&lt);/B(&gt);(please remove the bracket( ) while reading the text to understand my problem)
    my BOLD html tag is not parse by browser because xslt parser trasform
    my special tag into other tag.
    I want output like this:
    <b>Hello World</b>
    But it's coming like (&lt);B(&gt);Hello World(&lt);/B(&gt); (please remove the bracket( ) while reading the text to understand my problem)
    Can you help me ?
    this is my trasformation function :
    private Transformer getXSLTransformer (xslFile) throws
    XSLTransformerConfigurationException {
    try {
    Transformer transformer = null;
    tFactory = TransformerFactory.newInstance();
    transformer = tFactory.newTransformer(new
    StreamSource(xslFile)); // load xslFile from disk
    } catch (TransformerConfigurationException tce) {
    throw new XSLTransformerConfigurationException(tce.getMessage());
    return transformer;
    public String myTrasform(String xml,String xslFile) throws Exception {
    StringWriter outputString = new StringWriter(512);
    Transformer transformer = getXSLTransformer (xslFile);
    transformer.transform(new StreamSource(new StringReader(xml)), new
    StreamResult(outputString));
    return outputString.toString();
    Thank's in advance.
    kuruvi
    Edited by: Mc_Kuruvi on Jun 14, 2009 3:47 AM

    Read:
    Oracle® XML DB
    Developer's Guide
    10g Release 1 (10.1)
    Part No. B10790-01
    December 2003
    1. "Do I use sqlloader and what datatype?"
    Use XMLType
    2. "I have embedded graphics so do the images get stored separately or does the entire page get stored as a BLOB datatype?"
    Page 827:
    The Oracle XML DB native datatype XMLType helps store and manipulate XML. Multiple storage options (Character Large Object (CLOB) or structured XML) are available with XMLType, and administrators can choose a storage that meets their requirements. CLOB storage is an un-decomposed storage that is like an image of the original XML.

  • DOM Scripting - accessing XML CDATA values

    HI Folks,
    Not sure if this is the write forum, but I'm trying to use Javascript to output XML values onto my webpage, see below.
    This works fine, but when I try and get he values in a CDATA tag, I get undefined or null.
    Can anyone please tell me how to get CDATA content?
    <script type="text/javascript"
    xmlDoc=loadXMLDoc("news.xml");
    x=xmlDoc.getElementsByTagName('title');
    for (i=0;i<x.length;i++)
    document.write(x[i].childNodes[0].data);
    document.write("<br />");
    </script>
    XML
    <items>
      <item>
        <title>
          <![CDATA[text goes in here]]>
        </title>
    </item>
    </items>

    I think you will have more success on a JavaScript forum.
    Mack

  • How to validate xml file ?

    I try to validate my xml import file but I can't find proper validation and error message.
    the source where it originates is a system where also texts can be entered manually which are part of the xml file.
    I discoverd myself that & and ! are characters which are not allowed. but I'm looking for a way to check this before I process the xml file.
    I have this coding and I found smum_xml_parse but still the error is not clear about what is wrong ?
    try.
        CALL TRANSFORMATION ('ID')
        SOURCE XML it_xml_import
        RESULT order_header_in = st_sdhd1 order_conditions_in = ta_cond  order_partners = ta_parnr  order_text = ta_sdtext order_items_in = ta_sditm
    CATCH cx_xslt_exception INTO xslt_error.
    xslt_message = xslt_error->get_text( ).
        ASSIGN COMPONENT 'ERROR' OF STRUCTURE <l_line> TO <l_field>.
        <l_field> = xslt_message.
    data: gt_temp type STANDARD TABLE OF SMUM_XMLTB.
    itx_xml_import = it_xml_import.
    CALL FUNCTION 'SMUM_XML_PARSE'
      EXPORTING
        xml_input       = itx_xml_import
      tables
        xml_table       = gt_temp
        return          = ta_ret2
    ENDTRY.
    the xslt_message is also very unclear of what is exactly wrong with the file.
    are there any function which can give me more detailed information about the xml file and what is wrong with it ?
    Edited by: A. de Smidt on Feb 1, 2010 10:34 AM

    The ampersand is not allowed in XML CDATA, you must use the entity &amp;amp;

  • Line Break in XML?

    When I use "<br>" within my XML database, I get this
    error:
    "Expected end of tag 'br'(9,43)"
    I have tried <br>, </br>, <br></br>
    and searched... but haven't yet found a solution.
    Should I be using some kind of hex code?
    Thanks in advance for the assistance!
    Dan

    I spent a whole bloody day trying to solve this one!  Thanks for the advice here guys....
    Here's the "How to..." instructions I made for myself (I will need this later as a function of age)....
    Inserting <br /> line breaks in XML content:
    It's necessary to add a line of code directly after the dataset at the top of the (spry) htm page that sets the columnType:
    var dsRegInfoElem = new Spry.Data.XMLDataSet("regisinfo.xml", "sites/level1/site",{distinctOnLoad:true});
    dsRegInfoElem.setColumnType('datetime','html');<!--This line is necessary for the line breaks in the xml CDATA sections to work-->
    Make sure the xml tag that will contain the CDATA wrap is identified (here it's the <datetime> tag).
    Then, in the XML file, add the CDATA wrap just inside the tag like this:
    <datetime><![CDATA[texttexttexttext]]></datetime>
    Now just insert the <br /> where I need it!
    <datetime><![CDATA[texttext<br />texttext]]></datetime>

  • SetClob error, when putting XML doc to CLOB col via XSQL

    Hi,
    When I am trying to put an XML to a VARCHAR2 column, it works fine.
    However,
    when I am trying to put it to a CLOB column,
    the Apache Server generates an Internal Server Error.
    And the error_log of the Apache contains following error message:
    java.lang.NoSuchMethodError: oracle.jdbc.driver.OraclePreparedStatement: method setClob(ILjava/sql/Clob;)V not found
    at org.apache.jserv.JServConnection.processRequest(JServConnection.java:320)
    at org.apache.jserv.JServConnection.run(JServConnection.java:188)
    at java.lang.Thread.run(Thread.java)
    I am running Oracle8i (8.1.7) on Linux 2.2.16-3.
    Please give me a help.
    Thanks,
    Joseph
    The Table:
    SQL> desc XML_TEST;
    Name Null? Type
    CLOBTEST CLOB
    SQL>
    The XSQL File, test.xsql:
    <?xml version="1.0"?>
    <test connection="xxxx" xmlns:xsql="urn:oracle-xsql">
    <xsql:insert-request table="XML_TEST"
    transform="test.xsl"/>
    </test>
    The XSL File, test.xsl:
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml" cdata-section-elements="CLOBTEST"/>
    <xsl:template match="/">
    <ROWSET>
    <xsl:for-each select="request/parameters">
    <ROW>
    <CLOBTEST><xsl:value-of disable-output-escaping="yes" select="txtTest"/></CLOBTEST>
    </ROW>
    </xsl:for-each>
    </ROWSET>
    </xsl:template>
    </xsl:stylesheet>
    The HTML File, test.html:
    <HTML>
    <HEAD>
    </HEAD>
    <BODY>
    <FORM name="frmTest" action="test.xsql" method="POST">
    <B>Type in an XML Document:</B><BR>
    <TEXTAREA rows="10" style="width:100%" cols="70" name="txtTest"></TEXTAREA>
    <INPUT type="submit" value="Post XML Document">
    </FORM>
    </BODY>
    </HTML>
    null

    Steve,
    Your guess was right!!! Thank You.
    In my jserv.properties file,
    there were "classess111.zip" and "xsu12.jar" for the "wrapper.classpath".
    So, I modified the file to include only:
    "classess12.zip" and "xsu12.jar".
    After that, Internal Server Error was disappeared,
    but I got new errors for the response, as following:
    Oracle XSQL Servlet Page Processor 1.0.4.1 (Production)
    XSQL-017: Unexpected Error Occurred
    java.lang.NoClassDefFoundError: java/sql/Clob
    at oracle.jdbc.driver.OracleStatement.get_clob_value(OracleStatement.java:4447)
    at oracle.jdbc.driver.OracleStatement.getCLOBValue(OracleStatement.java:3025)
    at oracle.jdbc.driver.OracleCallableStatement.getCLOB(OracleCallableStatement.java:439)
    at oracle.xml.sql.dml.OracleXMLSave.createTempCLOBFromString(OracleXMLSave.java:2283)
    at oracle.xml.sql.dml.OracleXMLSave.setBindValue(OracleXMLSave.java:1218)
    at oracle.xml.sql.dml.OracleXMLSave.saveNodeVal(OracleXMLSave.java:2259)
    at oracle.xml.sql.dml.OracleXMLSave.saveNode(OracleXMLSave.java:2146)
    at oracle.xml.sql.dml.OracleXMLSave.saveNodes(OracleXMLSave.java:2061)
    at oracle.xml.sql.dml.OracleXMLSave.saveXML(OracleXMLSave.java:1954)
    at oracle.xml.sql.dml.OracleXMLSave.insertXML(OracleXMLSave.java:1060)
    at oracle.xml.xsql.actions.XSQLInsertRequestHandler.handleAction(XSQLInsertRequestHandler.java:126)
    at oracle.xml.xsql.XSQLDocHandler.getDocument(XSQLDocHandler.java:132)
    at oracle.xml.xsql.XSQLPageProcessor.process(XSQLPageProcessor.java:131)
    at oracle.xml.xsql.XSQLServlet.doGet(XSQLServlet.java:60)
    at oracle.xml.xsql.XSQLServlet.doPost(XSQLServlet.java:81)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:521)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
    at org.apache.jserv.JServConnection.processRequest(JServConnection.java:314)
    at org.apache.jserv.JServConnection.run(JServConnection.java:188)
    at java.lang.Thread.run(Thread.java)
    I am wondering if there are other mismatches.
    Thanks again,
    Joseph

  • OSB: fn-bea:inlinedXML format my signed XML

    Hello.
    I'm trying to replace my output xml message with the same message, but digitally signed.
    My proxy flow looks like:
    1. Call to BS.
    2. In response, take the output from BS and digitally sign it (Service callout to a signing service).
    3. Take the output from that service (it returns the signed xml into a "CDATA" section).
    4. Extract the xml (CDATA), and call to fn-bea:inlinedXML
    5. Substitute the output message with the xml in point 4).
    But "inlinedXML" seems to format the xml string (whitespace, line breaks,...), so the sign is no longer valid.
    ¿Can OSB convert from string to xml without formatting?.
    Thanks.

    Hello.
    Does anyone knows how to tell OSB to stop formatting my XML?.
    Thanks.

  • Soap adapter scenario error

    Hi,
    We are trying to sender messages with attachments from Portal using XI (SYNC) and the scenario is like this:
    Web Service <-> XI <-> web service
    I have completed all the required design and configurations to receive the data using SOAP adapter and send using SOAP adapters.
    For testing with the generated WSDL from Integration directory, when I try to send the SOAP request to server using the XMLSpy I am getting following warning.
    HTTP error: could not POST file on the server (500)
    Does it mean that WSDL generated from the configuration is not correct ?
    Thanks
    Sunil

    Prasad,
    I did not enter the name space and interface in the url while defining the web service.
    Here is what I did in order to define web service for the scenario in the intgration directory after desiging the interface in the IR.
    1.Selected the define web service under tools in the ID.
    2. To specify the URL I have entered the following info as per help documentation for service without party:
    http://<hostname>:50000/XISOAPAdapter/MessageServlet?channel=:DEngine:BMP_Request.
    3. In the specify interface I have selected the outbound interface.
    4. Then specified the service,interface name and inteface namespace as they are required.
    5. With the generated WSDL from XI, using XML Spy I tried to send the request to server and I got the HTTP POST 500 error as I mentioned in the beginning. And here is the error message after I clicked OK on the error message in the XML CDATA tag.
    com.sap.aii.af.ra.ms.api.DeliveryException: XIAdapter:ADAPTER.SOAP_EXCEPTION:soap fault: Server did not recognize the value of HTTP Header SOAPAction:
    Please correct me if I did not followed the procedure correctly in this scenario.
    Thanks
    Sunil

  • SISS AND SSDT when i try to open the package i am getting the error? can you please send the solution ASAP.

    Micro Visual Studio is unable to load this document
    failed to load XML due to error 0*C00CE564 "A CDATA section was not closed,Line 10622,Column 38",
    This file occurs when loading a package and a file cannot be opened or loaded correctly into the XML document.
    This can be result of specifying an incorrect file name to the loadPackage method or specified XML is an incorrect format.

    Hi sreedhar875,
    Based on my research, the issue is caused by the package XML file got corrupted. Means there are some errors in the XML file.
    Based on the error message, it seems that the error is “A CDATA section was not closed” which located at Line 10622, Column 38. A CDATA section starts with "<![CDATA[" and ends with "]]>", please verify that the CDATA section is
    closed by "]]>".
    Reference:
    XML CDATA
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Using a variable value in CDATA for generating an XML type in Oracle

    Hello,
    I have prepared a function given below where I have some input variables & I have to generate one XML with those input variables as tag attribute value:
    create or replace function NEW_PROJECT_DETAILS
    ( p_ReferenceId in varchar2 ,
    p_Project_No in varchar2,
    p_Project_Name in varchar2,
    p_Project_Desc in varchar2 ,
    p_Project_Type in varchar2,
    p_Project_Location in varchar2,
    p_Project_Status in varchar2 )
    return xmltype
    as
    payload xmltype;
    begin
    dbms_output.put_line('Payload Started');
    payload:= xmltype('<?xml version="1.0" encoding="UTF-8"?>
    <ProjectDetails>
    <RefID>'||p_ReferenceId||'</RefID>
    <ProjectNo>'||p_Project_No||'</ProjectNo>
    <ProjectName>'||p_Project_Name||'</ProjectName>
    <ProjectDesc>'||p_Project_Desc||'</ProjectDesc>
    <ProjectType>'||p_Project_Type||'</ProjectType>
    <ProjectLocation><![CDATA[p_Project_Location]]></ProjectLocation>
    /* <ProjectLocation>'||p_Project_Location||'</ProjectLocation> */
    <ProjectStatus>'||p_Project_Status||'</ProjectStatus>
    </ProjectDetails>');
    dbms_output.put_line('Payload Comp1');
    return payload;
    end;
    This procedure works absolutely fine.
    Now the problem which I am having is that the variable p_Project_Location has value like "6747:BBO&M SBV".
    Due to the '*&*' in that value I have to use CDATA. But i dont know how to pass this variable directly in the CDATA in the XML.
    Please help me with this asap.
    Thanks & Regards,
    Divya Aggarwal
    Edited by: 784414 on Dec 2, 2010 4:15 AM
    Edited by: 784414 on Dec 2, 2010 4:16 AM

    Hi,
    If you absolutely want to use a CDATA section, then :
    payload:= xmltype('<?xml version="1.0" encoding="UTF-8"?>
    <ProjectDetails>
    <RefID>'||p_ReferenceId||'</RefID>
    <ProjectNo>'||p_Project_No||'</ProjectNo>
    <ProjectName>'||p_Project_Name||'</ProjectName>
    <ProjectDesc>'||p_Project_Desc||'</ProjectDesc>
    <ProjectType>'||p_Project_Type||'</ProjectType>
    <ProjectLocation><![CDATA['||p_Project_Location||']]></ProjectLocation>
    <ProjectStatus>'||p_Project_Status||'</ProjectStatus>
    </ProjectDetails>');Alternatively, you can escape non valid characters with DBMS_XMLGEN.CONVERT, e.g. :
    payload:= xmltype('<?xml version="1.0" encoding="UTF-8"?>
    <ProjectDetails>
    <RefID>'||p_ReferenceId||'</RefID>
    <ProjectNo>'||p_Project_No||'</ProjectNo>
    <ProjectName>'||p_Project_Name||'</ProjectName>
    <ProjectDesc>'||p_Project_Desc||'</ProjectDesc>
    <ProjectType>'||p_Project_Type||'</ProjectType>
    <ProjectLocation>'||dbms_xmlgen.convert(p_Project_Location)||'</ProjectLocation>
    <ProjectStatus>'||p_Project_Status||'</ProjectStatus>
    </ProjectDetails>');which outputs :
    <?xml version="1.0" encoding="UTF-8"?>
    <ProjectDetails>
    <RefID>1</RefID>
    <ProjectNo>1</ProjectNo>
    <ProjectName>PRJ1</ProjectName>
    <ProjectDesc>This is project 1</ProjectDesc>
    <ProjectType>P</ProjectType>
    <ProjectLocation>6747:BBO&amp;M SBV</ProjectLocation>
    <ProjectStatus>S</ProjectStatus>
    </ProjectDetails>Any basic XML parser should then convert back escaped characters when processing the document.
    You can also use SQL/XML functions, which will take care of that automatically.
    For example :
    SELECT appendChildXML(
            XMLType('<?xml version="1.0" encoding="UTF-8"?><ProjectDetails/>'),
            XMLForest(
             '1'                 as "RefID",
             '1'                 as "ProjectNo",
             'PRJ1'              as "ProjectName",
             'This is project 1' as "ProjectDesc",
             'P'                 as "ProjectType",
             '6747:BBO&M SBV'    as "ProjectLocation",
             'S'                 as "ProjectStatus"
    FROM dual;or,
    SELECT appendChildXML(
            XMLType('<?xml version="1.0" encoding="UTF-8"?><ProjectDetails/>'),
            XMLForest(
             '1'                 as "RefID",
             '1'                 as "ProjectNo",
             'PRJ1'              as "ProjectName",
             'This is project 1' as "ProjectDesc",
             'P'                 as "ProjectType",
             XMLCData('6747:BBO&M SBV') as "ProjectLocation",
             'S'                 as "ProjectStatus"
    FROM dual;

Maybe you are looking for

  • Error while deleting a custom group associated with role 'BIConsumer'

    Hi All, We are using OBIEE 11.1.1.6.2 and using the BISQLGroupProvider to get the groups from database tables for an user available in LDAP. I have a group named 'OBA Test Group' created in a database table. This group is linked to a user in another

  • Using decode function without negative values

    Hi friends I am using oracle 11g I have at doubt regarding the following. create table Device(Did char(20),Dname char(20),Datetime char(40),Val char(20)); insert into Device values('1','ABC','06/13/2012 18:00','400'); insert into Device values('1','a

  • Error:maximum investment amount exceeded in area 51

    Hello, When I am reversing the retirement document in AB08 , I am getting the error as "maximum investment amount exceeded in area 51". I maintian the maximum amount for area 51 in customizing, but still there is error. Is there any other way to reve

  • Evaluate function in teststand status expression

    Hello, I can not understand the meaning of function Evaluate() in below sentence,and can not find the explanation in help files,could someone help me ? Step.DataSource != "Step.Result.PassFail" ? Step.Result.PassFail = Evaluate(Step.DataSource) : Fal

  • Master Data Reporting on  0EMPLOYEE & 0HRPOSITION

    Hi Gurus,    My requirment is to develop a BW report on HR Master Data for which i need part of data from   0EMPLOYEE  and remaining half  0HRPOSITION Can any one please let me know how can i acieve this...in detail please Thanks