Assigning xml to CDATA in OSB

Hi!
I have a Tuxedo proxy service in Oracle Service Bus. It recieves an XML. First, I want to know how to transform this XML to CDATA to be sent as an argument to an web service operation. And secondly - how to transform the responce in the web service, which is in a CDATA section to an XML to be manipulated afterward.

I have a Tuxedo proxy service in Oracle Service Bus. It recieves an XML. First, I want to know how to transform this XML to CDATA to be sent as an argument to an web service operation. Simple example where given XML is converted into CDATA element in $body
Replace . in variable body with fn-bea:serialize(xs:string(fn:concat("<![CDATA[",fn-bea:serialize($body),"]]>")))
Replace node contents selected
Input
<manoj/>
Output (forums is not not showing the data in the CDATA)
<![CDATA[<soap-env:Body xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"><manoj/></soap-env:Body>]]>
Let me know if this solves the first problem.
Edited by: mneelapu on Apr 29, 2009 10:03 AM

Similar Messages

  • How to convert XML to Binary in OSB Message flow

    Dear All,
    Can you please help me in converting XML to Binary in OSB Message flow.
    Please help.
    Thanks,

    ah ok, then you have to apply a transformation from XML to some fixed length format, EDI style
    probably you have 2 options: the traditional MFL
    http://docs.oracle.com/cd/E13159_01/osb/docs10gr3/consolehelp/mfls.html
    or the (probably) more supported nXSD with a JCA adapter
    http://docs.oracle.com/cd/E23943_01/integration.1111/e10231/nfb.htm
    I will let you digest this info and then we can continue.
    There are a number of threads in this forum on whether one technology is better than the other (as usual, google can assist you)

  • Problem while creating xml with cdata section

    Hi,
    I am facing problem while creating xml with cdata section in it. I am using Oracle 10.1.0.4.0 I am writing a stored procedure which accepts a set of input parameters and creates a xml document from them. The code snippet is as follows:
    select xmlelement("DOCUMENTS",
    xmlagg
    (xmlelement
    ("DOCUMENT",
    xmlforest
    (m.document_name_txt as "DOCUMENT_NAME_TXT",
    m.document_type_cd as "DOCUMENT_TYPE_CD",
    '<![cdata[' || m.document_clob_data || ']]>' as "DOCUMENT_CLOB_DATA"
    ) from table(cast(msg_clob_data_arr as DOCUMENT_CLOB_TBL))m;
    msg_clob_data_arr is an input parameter to procedure and DOCUMENT_CLOB_TBL is a pl/sql table of an object containing 3 attributes: first 2 being varchar2 and the 3rd one as CLOB. The xml document this query is generating is as follows:
    <DOCUMENTS>
    <DOCUMENT>
    <DOCUMENT_NAME_TXT>TestName</DOCUMENT_NAME_TXT>
    <DOCUMENT_TYPE_CD>BLOB</DOCUMENT_TYPE_CD>
    <DOCUMENT_CLOB_DATA>
    &lt;![cdata[123456789012345678901234567890123456789012]]&gt;
    </DOCUMENT_CLOB_DATA>
    </DOCUMENT>
    </DOCUMENTS>
    The problem is instead of <![cdata[....]]> xmlforest query is encoding everything to give &lt; for cdata tag. How can I overcome this? Please help.

    SQL> create or replace function XMLCDATA_10103 (elementName varchar2,
      2                                             cdataValue varchar2)
      3  return xmltype deterministic
      4  as
      5  begin
      6     return xmltype('<' || elementName || '><![CDATA[' || cdataValue || ']]>
      7  end;
      8  /
    Function created.
    SQL>  select xmlelement
      2         (
      3            "Row",
      4            xmlcdata_10103('Junk','&<>!%$#&%*&$'),
      5            xmlcdata_10103('Name',ENAME),
      6            xmlelement("EMPID", EMPNO)
      7         ).extract('/*')
      8* from emp
    SQL> /
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[SMITH]]></Name>
      <EMPID>7369</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[ALLEN]]></Name>
      <EMPID>7499</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[WARD]]></Name>
      <EMPID>7521</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[JONES]]></Name>
      <EMPID>7566</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[MARTIN]]></Name>
      <EMPID>7654</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[BLAKE]]></Name>
      <EMPID>7698</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[CLARK]]></Name>
      <EMPID>7782</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[SCOTT]]></Name>
      <EMPID>7788</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[KING]]></Name>
      <EMPID>7839</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[TURNER]]></Name>
      <EMPID>7844</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[ADAMS]]></Name>
      <EMPID>7876</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[JAMES]]></Name>
      <EMPID>7900</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[FORD]]></Name>
      <EMPID>7902</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[MILLER]]></Name>
      <EMPID>7934</EMPID>
    </Row>
    14 rows selected.
    SQL>

  • Parsing HTML inside CDATA in OSB

    hi,
    how to parse the HTML content wrapped by CDATA in OSB?
    for example..
    below is the request...
    <soapenv:Body      xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
         &lt;html>&lt;body>"hi"&lt;/br>h r u&lt;/body>&lt;/html>
    </soapenv:Body>
    i need to parse the html content alone...
    can anybody please provide a solution to this..
    :(

    If above is the request then $body/* will give you the HTML content. You may apply XPath to traverse through child nodes. Post OSB related queries in SOA suite forum -
    SOA Suite
    Regards,
    Anuj

  • Converting XML to String in OSB

    Hi All,
    Is there any function (apart from fn-bea:serialize function) for converting XML payload to a String in OSB. Please let me know.
    Thanks,
    Bpeltechie

    That's how it's worded by W3C
    http://www.w3.org/TR/REC-xml/#syntax
    The ampersand character (&) and the left angle bracket (<) must not appear in their literal form, except when used as markup delimiters, or within a comment,
    a processing instruction, or a CDATA section. If they are needed elsewhere, they must be escaped using either numeric character references or the
    strings " &amp; " and " & lt; " respectively. The right angle bracket (>) may be represented using the string " & gt; ", and must, for compatibility, be
    escaped using either " & gt; " or a character reference when it appears in the string " ]]> " in content, when that string is not marking the end
    of a CDATA section.Note that it says left angle bracket must not appear in their literal form, but the right angle bracket may be represented using the string " &amp;gt; "
    Cheers,
    Vlad

  • Stripping CDATA in OSB

    Hi there,
    I have an incoming message which has CDATA tag in it...
    Is there an easy way to stip the CDATA and just return the raw xml?
    I tried some osb/xquery replace... but it does not seem to work...
    [OSB Tracing] Entering stage stage1 with message context:
    [MessageContextImpl  body="<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><![CDATA[<PURCHASE_ORDER_150 partner="XXX" transaction="PURCHASEORDER" version="1.50" timestamp="2011-04-19T10:36:55" ...................
    ......_QTY_ORDERED></CONTROL></PURCHASE_ORDER_150>]]></soapenv:Body>"
    Thanks
    Ganesh

    (:: pragma bea:global-element-parameter parameter="$pURCHASE_ORDER_1501" element="ns0:PURCHASE_ORDER_150" location="GG_ORDER.xsd" ::)
    (:: pragma bea:global-element-return element="ns1:GGGetOrderResponse" location="GGGetOrder.xsd" ::)
    declare namespace ns1 = "http://www.sample.com/GetHttpOrder/GGGetOrder";
    declare namespace ns0 = "http://sample";
    declare namespace xf = "http://tempuri.org/GG_Order/asdasd/";
    declare function xf:asdasd($pURCHASE_ORDER_1501 as element(ns0:PURCHASE_ORDER_150))
    as element(ns1:GGGetOrderResponse) {
    <ns1:GGGetOrderResponse>
    <ns0:PURCHASE_ORDER_150>{ $pURCHASE_ORDER_1501/@* , $pURCHASE_ORDER_1501/node() }</ns0:PURCHASE_ORDER_150>
    </ns1:GGGetOrderResponse>
    declare variable $pURCHASE_ORDER_1501 as element(ns0:PURCHASE_ORDER_150) external;
    xf:asdasd($pURCHASE_ORDER_1501)
    Edited by: Ganesh on Apr 27, 2011 9:41 PM

  • Having issue with XML in CDATA tag

    Currently I am having a major issue that I've been dealing with for the last four days unsuccessfully.  I run a search against our data provider (lets say the term searched on is 'foobar').  We get back an XML document on our server along with a list of objects that has the start index of where the hit terms are found and the length from the start of the index (our data provider calculates all of this for us).  We then take that XML document in its exact state as it's given to us from our data provider and wrap it in a CDATA tag and put it into another XML document and pass that to our FLEX app.  The document looks something like this coming back from the server (we're using REST).  This is not the true original document as it was shortened for readability.
    <?xml version="1.0" encoding="UTF-8"?>
    <Document>
    <ID>123456</ID>
    <HITTERMS>
    <HITTERM index="45" length="6" />
    <HITTERM index="105" length="6" />
    <HITTERM index="260" length="6" />
    </HITTERMS>
    <DocumentXML><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
    <DOC DOCUMENT_ID="123456" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <METADATA>
    <ID>123456</ID>
    <LANGUAGE>ENGLISH</LANGUAGE>
    <SOURCEDATA>1/1/2009</SOURCEDATA>
    <SOURCE>AP</SOURCE>
    </METADATA>
    <ARTICLE>
    <TITLE>Some title with foobar</TITLE>
    <TEXT>
    There would be just standard text.
    Some breaks for example like the start of new paragraphs, but otherwise all the foobar text would be condensed like this.
    </TEXT>
    </ARTICLE>
    </DOC>]]></DocumentXML>
    </Document>
    I've confirmed the XML coming from the server looks exactly as it does above. The issue is for some reason whenever I try to get the text out of '<DocumentXML>' it formats the code in a way that won't work for me since it throws off the offsets of the hit terms and changes the original document.  Whenever I do a .toString() on the XML it puts breaks before each '<' and after each '>' so it spaces everything out inside the CDATA tag.  Now the XML looks like this when turned into a string:
    <?xml version="1.0" encoding="UTF-8"?>
    <Document>
    <ID>123456</ID>
    <HITTERMS>
    <HITTERM index="45" length="6" />
    <HITTERM index="105" length="6" />
    <HITTERM index="260" length="6" />
    </HITTERMS>
    <DocumentXML><![CDATA[
    <?xml version="1.0" encoding="UTF-8"?>
    <DOC DOCUMENT_ID="123456" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <METADATA>
    <ID>123456</ID>
    <LANGUAGE>ENGLISH</LANGUAGE>
    <SOURCEDATA>1/1/2009</SOURCEDATA>
    <SOURCE>AP</SOURCE>
    </METADATA>
    <ARTICLE>
    <TITLE>Some title with foobar</TITLE>
    <TEXT>
    There would be just standard text.
    Some breaks for example like the start of new paragraphs, but otherwise all the foobar text would be condensed like this.
    </TEXT>
    </ARTICLE>
    </DOC>
    ]]>
    </DocumentXML>
    </Document>
    I need to be able to keep the original document as-is in the first example so I can calculate where the hit terms are so that I can highlight them and there are things further down the road that I'm going to need to be able to do so a simple search and replace will not get the job done unfortunately.  Has anyone ever encountered this before or have any idea possibly how to fix this.  Thanks in advance to anyone who can help with this.

    Didn't work.  Now it spaces out all of the XML, not just the document wrapped in the CDATA tag.  Looks like this now:
    <?xml version="1.0" encoding="UTF-8"?>
    <Document>
    <ID>123456</ID>
    <HITTERMS>
    <HITTERM index="45" length="6" />
    <HITTERM index="105" length="6" />
    <HITTERM index="260" length="6" />
    </HITTERMS>
    <DocumentXML>
    <![CDATA[<?xml version="1.0" encoding="UTF-8"?>
    <DOC DOCUMENT_ID="123456" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <METADATA>
    <ID>123456</ID>
    <LANGUAGE>ENGLISH</LANGUAGE>
    <SOURCEDATA>1/1/2009</SOURCEDATA>
    <SOURCE>AP</SOURCE>
    </METADATA>
    <ARTICLE>
    <TITLE>Some title with foobar</TITLE>
    <TEXT>
    There would be just standard text.
    Some breaks for example like the start of new paragraphs, but otherwise all the foobar text would be condensed like this.
    </TEXT>
    </ARTICLE>
    </DOC>
    ]]>
    </DocumentXML>
    </Document>

  • Transforming XML/XSLT : CDATA problem

    Hi!
    I have a problem transforming xml with XSLT using the API javax.xml.
    The result is correct until I have a CDATA section in my xml document.
    The transforming process encodes all the & < > (special characters) it finds in.
    This occurs problem for the follow of my treatement because the content of my CDATA is already encoded.
    For example, this xml code :
    <?xml version='1.0' encoding="ISO-8859-1" ?>
    <article>
    <article-contenu><![CDATA[Accent : &eacute; Signe : &lt;]]></article-contenu>
    </article>
    produces in my output :
    Accent : &amp;eacute; Signe : &amp;lt;
    This is my java code :
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Source xmlSource = new StreamSource(readerXml);
    Source xslSource = new StreamSource( fileXsl );
    // Generate the transformer.
    Transformer transformer = tFactory.newTransformer(xslSource);
    // Perform the transformation, sending the output to the response.
    transformer.transform(xmlSource, new javax.xml.transform.stream.StreamResult(sw));
    How can I tell the transformer not to do that?
    Thanks for your answers!

    I am having a similar problem. I have enclosed my text data in my xml file like this:
    <![CDATA[<b>Hello World!</b>]]>
    My select statement in my XSLT sheet is as follows:
    <xsl:value-of select="." disable-output-escaping="yes"/>
    I have tried setting xsl:output to text, to html, and to xml. The <, >, and & get converted to xhtml entities.
    Where should I begin to troubleshoot? If the Xalan xslt jars? My stylesheet. My xml doc? Java code?
    Any feedback welcome.

  • Maximum input payload size(for an XML file) supported by OSB

    Hey Everyone,
    I wanted to know, what is the maximum payload size that OSB can handle.
    The requirement is to pass XML files as input to OSB and insert the data of the XML files in the oracle staging tables. The OSB will host all the .jca,wsdl, xml, xml schema and other files required to perform the operation.
    The hurdle is to understand, what is the maximum XML file size limit, that OSB can allow to pass through without breaking.
    I did some test runs and got the following output,
    Size of the XML file:  OSB successfully read a file of size, 3176kb but failed for a file of size 3922kb, so the OSB breakpoint occurs somewhere between 3-4 MB, as per the test runs.
    Range of number of Lines of XML:  102995 to 126787, since OSB was able to consume a file with lines (102995) and size 3176kb but broke for a file with number of lines (126787) and size 3922kb.
    Request to please share your views on the test runs regarding the OSB breakpoint and also kindly share the results, if the same test has been performed at your end.
    Thank you very much.

    Hey Everyone,
    I wanted to know, what is the maximum payload size that OSB can handle.
    The requirement is to pass XML files as input to OSB and insert the data of the XML files in the oracle staging tables. The OSB will host all the .jca,wsdl, xml, xml schema and other files required to perform the operation.
    The hurdle is to understand, what is the maximum XML file size limit, that OSB can allow to pass through without breaking.
    I did some test runs and got the following output,
    Size of the XML file:  OSB successfully read a file of size, 3176kb but failed for a file of size 3922kb, so the OSB breakpoint occurs somewhere between 3-4 MB, as per the test runs.
    Range of number of Lines of XML:  102995 to 126787, since OSB was able to consume a file with lines (102995) and size 3176kb but broke for a file with number of lines (126787) and size 3922kb.
    Request to please share your views on the test runs regarding the OSB breakpoint and also kindly share the results, if the same test has been performed at your end.
    Thank you very much.

  • Assigning XML Document Message to XSD Instance

    Hi,
        I have constrcuted below  XML Document mesaage  ( System.XML.XMLDocument) and I have created xsd schema for the same and I would like to assign the XML Document to the xsd schema instace inside Orchestration.
    Pl let me know what is How to assign inside Orchestration.
    <BacklogMaterial SAPMaterialNumber="100010" xmlns="http://www.myorg.com/InventoryBroker">
    <Quantity UOM="EA">41</Quantity>
    </BacklogMaterial>

    i think since you already have a variable of type System.XML.XMLDocument
    you can directly assign that to the xsd schema message variable
    like say you have following variables
    1. xmldoc that holds the XML
    Document mesaage
    2. outputmsg  variable of type xsd schema instance
    then you can directly assign as
    outputmsg=xmldoc
    make sure you use message assignment shape.
    Please mark the post as answer if this answers your question. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Receive xml as string from OSB and pass it to Bpel

    I was given xml and DTD by our external partners. I need to receive this xml, parse this and insert some of the
    values of the elements into DB.
    Question1:
    Since I don't have WSDL, can I receive xml in string and pass it on to OSB BS which calls Bpel process?
         If yes, how and can I get any example?
    How do I set up osb bs service to talk to bpel?
    I have installed oracle soa suite 10g with patch set 4. This runs with Oracle AS. I have my Bea weblogic 10.3 with OSB installed.
    Both the servers are running seperately.

    If I use
    string to xml --- fn-bea:inlinedXML()
    How do I extract a value of an element? When I log the xml that got extracted from a string, I only see the values of elements with no element names:
    eg: if incoming string format of xml is:
    <Customer>
    <name>aaa</name>
    <address>bb</address>
    </Customer>
    After fn-bea:inlinedXML($body)
    I see:
    aaa
    bbb
    in the log, but with no element names

  • Inline XML with CDATA problem

    Hi everyone,
    I'm trying to include some JavaScript (JSON 2, to be precise)
    in with some ActionScript 3 classes. I'm using the inline XML
    method (E4X) of declaring the data. It looks like this:
    public static var JSON_2:XML = <data><![CDATA[
    if (!this.JSON) {
    JSON = function () {
    function f(n) {
    return n < 10 ? '0' + n : n;
    Date.prototype.toJSON = function (key) {
    return this.getUTCFullYear() + '-' +
    f(this.getUTCMonth() + 1) + '-' +
    f(this.getUTCDate()) + 'T' +
    f(this.getUTCHours()) + ':' +
    f(this.getUTCMinutes()) + ':' +
    f(this.getUTCSeconds()) + 'Z';
    String.prototype.toJSON =
    Number.prototype.toJSON =
    Boolean.prototype.toJSON = function (key) {
    return this.valueOf();
    var cx = /[\u0000
    ]]></data>
    Actually, this is only about a quarter of what I need to
    include but this is where it breaks down. Right after the second
    slash in the last line, Flash reports:
    TypeError: Error #1091: XML parser failure: Unterminated CDATA
    section.
    In fact, as you can see this is a perfectly valid CDATA
    section and isn't being terminated anywhere (there is no instance
    of "]]>" anywhere in the data). Unfortunately, Flash doesn't
    think so and seems to think that the backslash is an XML node
    directive.
    Does anyone have an idea of how to effectively deal with
    this? The JSON source code has *many* backslashes so not having to
    convert them would be *very* useful.
    Many thanks for all your suggestions,
    Patrick

    I've *kind* of solved the problem...replacing each backslash
    ("\") with a double backslash ("\\"). At least this has removed the
    compiler error. However, this would suggest that the CDATA section
    is actually being interpreted by Flash, which is something it isn't
    supposed to do...or did I misunderstand how this works?

  • Using Business Service that supports XML over HTTP in OSB

    Hi,
    I needed to integrate my system with another legacy system that supports communication only through XML over HTTP. I am just trying to understand much about this XML over HTTP. I think in OSB, this is possible only possible through REST interfaces.
    Is there any other way and what about HTTP bindings in WSDLs? can you please let me know if you have any insights.
    I have gone through the urls about REST interfaces given in these forums. But just wanted to confirm the following scenaiors possible in OSB.
    - Client will connect to SOAP based proxy service which will in turn call REST based business service.
    - Client will connect to REST base proxy service which will in turn call SOAP based business service.
    Following point is not clear from the URLs i went through so just wanted to confirm the following too:
    - Client will connect to REST base proxy service which will in turn call SOAP based business service. And is it possible to add anything in soap header before calling soap based business service..
    Thanks & Regards
    Siva

    Hi Siva,
    XML over HTTP is a general use case and OSB supports it very well. REST is a special case and should be used when required. To know more about REST you may refer -
    http://www.infoq.com/articles/rest-introduction
    Now coming to OSB, SOAP and simple XML are two different cases. If you are creating XML type service then it is not binded to a WSDL/XSD but SOAP based service should always be binded with a WSDL. You may add/modify transport headers in OSB.
    Evaluate your requirements and then decide what exactly you need to use. Few links which may be of your use -
    http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/configuringandusingservices.html#wp1150438
    http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/configuringandusingservices.html#wp1154255
    http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/configuringandusingservices.html#wp1141071
    section "Configuring Business Services using the HTTP Transport" here - http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/httppollertransport/transports.html#wp1083292
    http://blogs.oracle.com/jeffdavies/2009/06/restful_services_with_oracle_s_1.html
    http://blogs.oracle.com/jamesbayer/2008/07/using_rest_with_oracle_service.html
    Regards,
    Anuj

  • How to generate xml having CDATA from a query

    I have the following query
    with data_tab as ( select 'Geetha' "code" ,'Book' "category" from dual union           
    select 'Nokia' "code" ,'mobile' "category" from dual )
    select Xmltype(cursor(select * from data_tab)) from dualand the output is
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
      <code>Geetha</code>
      <category>Book</category>
    </ROW>
    <ROW>
      <code>Nokia</code>
      <category>mobile</category>
    </ROW>
    </ROWSET>but I want ot insert CDATA in xml.
    that is I need this xml in the following format.
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
      <code>![CDATA[Geetha]]</code>
      <category>![CDATA[Book]]</category>
    </ROW>
    <ROW>
      <code>![CDATA[Nokia]]</code>
      <category>![CDATA[mobile]]</category>
    </ROW>
    </ROWSET>Please help me on this. In my original query, I am selecting from a record type and it is nested.So I cannot change the query select * from data_tab

    SQL> with t as(select xmltype('<?xml version="1.0"?>
      2  <ROWSET>
      3   <ROW>
      4    <code>Geetha</code>
      5    <category>Book</category>
      6   </ROW>
      7   <ROW>
      8    <code>Nokia</code>
      9    <category>mobile</category>
    10   </ROW>
    11  </ROWSET>') xml from dual)
    12  --
    13  select xmlelement("ROWSET",
    14                    XMLQuery ( 'for $i in /ROWSET/ROW
    15                                let $codenew := concat("![CDATA[",$i/code,"]]")
    16                                let $categorynew := concat("![CDATA[",$i/category,"]]")
    17                                 return element ROW{ element code{$codenew}, element code{$catego
    rynew}}'
    18                                passing by value xml
    19                                RETURNING CONTENT)
    20        ) XMLData
    21   from t
    22  /
    XMLDATA
    <ROWSET><ROW>
      <code>![CDATA[Geetha]]</code>
      <code>![CDATA[Book]]</code>
    </ROW>
    <ROW>
      <code>![CDATA[Nokia]]</code>
      <code>![CDATA[mobile]]</code>
    </ROW>
    </ROWSET>
    SQL>

  • Check XML for CDATA

    Hello,
    I have an XML document with the following structure -
    <test>
    <![CDATA[123 345 6677 777]]>
    </test>
    there is a variable mydoc which references to the above xml
    document.
    How do I test if the CDATA section is empty? Can I do
    something like -
    mydoc.test.cdata == null or something of that sort?
    Thanks!

    Thanks for your response. Is it possible to capture the
    output of trace? I mean trace will print to the console but I would
    like to capture it in a variable. Thsi will actually help me to
    test if the CDATA section is empty or not.

Maybe you are looking for

  • Is there a keyboard shortcut to open first google search result in a new page?

    I would like to go to the first result of a google search easily, as I do in Chorme. In Chrome you can click TAB to hi-light the first result's link, then with a click open it. In Firefox, I can't do this, because if I click on TAB it will require me

  • How can i successfully install linux on my ppc g5

    so... i have a pretty old machine. however it's still in great condition, all parts intact. it's running 10.5.8. there are the obvious issues due to lack of support for this os and all compatible software. i also had to leave it in storage for a whil

  • Multiple screens - can't drag windows

    Since I upgraded to Mountain Lion I can't drag a window from a screen to another (of course in case I use a second display) if they are arranged as one is below, another on the top (see the attached screen shot). Do you have any idea how to solve thi

  • Corrupted BB Q10 due to wrong password

    My blackberry q10 was corrupted after accidentally entering 10 wrong password. I forgot my password, what should I do? this phone is contract to Globe telecom here in the Philippines, they said that blackberry just gave them 1 year warranty the reaso

  • ABAP Class to start Infopackage load

    I want to write a little interface that allows a non-tech user to provide a desktop file (.csv) allow a selection of filetype (sales, repair, historical, demand) and a button to start the load process. The file is then transfered to the BW system and