How to identify a CDATA section in DOM API?

I'm having a problem reading a CDATA section from using the DOM API. A call to Node.getNodeType() doesn't return CDATA_SECTION_NODE as expected but returns TEXT_NODE. Also, a call to getValue() doesn't return <![CDATA[<foo>]]> but returns
<foo> instead. Does anyone know how to get getNodeType() to return the proper value?
For example suppose I have the following XML:
<?XML version="1.0"?>
<document>
<elm><![CDATA[text with <b>HTML</b>]]></elm>
</document>
A call to getNodeType() for the value Node (the child of the <elm> node) returns TEXT_NODE. I would expect it to return CDATA_SECTION_NODE.
Ken

C'mon Oracle people -- help me out here,
Is this a known bug or what? I just discovered that if you do a cloneNode()
the CDATA section gets messed up, too.
Ken
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Kenneth Liu ([email protected]):
I'm having a problem reading a CDATA section from using the DOM API. A call to Node.getNodeType() doesn't return CDATA_SECTION_NODE as expected but returns TEXT_NODE. Also, a call to getValue() doesn't return <![CDATA[<foo>]]> but returns
<foo> instead. Does anyone know how to get getNodeType() to return the proper value?
For example suppose I have the following XML:
<?XML version="1.0"?>
<document>
<elm><![CDATA[text with <b>HTML</b>]]></elm>
</document>
A call to getNodeType() for the value Node (the child of the <elm> node) returns TEXT_NODE. I would expect it to return CDATA_SECTION_NODE.
Ken<HR></BLOCKQUOTE>
null

Similar Messages

  • CreateCDATASection() method doesn't creates a CDATA Section.

    Hi,
    While using Oracle XDK, if I try to create a CDATA Section using createCDATAsection() method, it doen't creates a CDATA Section. Instead it creates a normal Text node. If I try the same code with Apache Xerces, it works fine and I have CDATA section.
    The problem I am facing because, my node data has some special characters and I don't want parser to validate that. Has anyone else faced the same problem or have a work around?
    Any help will be appreciated.
    Thanks,
    Atif

    The double square bracket closing the CDATA section was never a problem. I had issues with LrXml encoding the opening angle bracket as an &lt; entity:
        local xml = LrXml.createXmlBuilder(false)
        xml:beginBlock("var")
        xml:tag("name", "var1")
        xml:beginBlock("value")
        xml:tag("string", "<![CDATA[value123]]>")
        xml:endBlock()
        xml:endBlock()
        local strXML = xml:serialize()
    Produces the following maligned XML:
    <?xml version="1.0"?>
    <var>
    <name>var1</name>
    <value>
    <string>&lt;![CDATA[value123]]></string>
    </value>
    </var>
    I guess one way to go about it is to run serialized XML through string.gsub to un-encode the "&lt;![CDATA[" sequence as follows:
    strXML = string.gsub(strXML, "&lt;!%[CDATA%[", "<![CDATA[")
    This is a nasty workaround, but this appears to be the only way to get the job done. Now my serialized XML looks as expected:
    <?xml version="1.0"?>
    <var>
    <name>var1</name>
    <value>
    <string><![CDATA[value123]]></string>
    </value>
    </var>
    This only leaves me wondering as to why LrXml doesn't support CDATA sections through its API, they are not that uncommon...

  • How do i return a CDATA section in a SOAP response?

    hi,
    i am relatively new to SOAP/web services. but i know what i want ;-). i naively thought that i could simply send a CDATA wrapped string in a SOAP response by simply doing SOAPElement.addTextNode("<![CDATA[..."). of course, WLS 8.1's javax.xml.soap implementation escapes the <pre>"<" & ">"</pre> as <pre>"<" and ">"</pre> in the response.
    IF i could use the saaj 1.2 implementation, i would do something along the lines of the following to return a CDATA section in a SOAP response :
    <pre>  
       org.w3c.dom.CDATASection myCDATASection ...;
       SOAPBodyElement myBodyElement ...;
       myBodyElement.appendChild(myCDATASection);
    </pre>
    or maybe even something like:
    <pre>
       String myCDATAString = "<![CDATA[...]]>";
    javax.xml.soap.SOAPBody soapBody = ...;
    javax.xml.parsers.DocumentBuilder builder = ...;
    org.xml.sax.InputSource.InputSource inputSource = ...;
    org.w3c.dom.Document document = builder.parse(inputSource);
    soapBody.addDocument(document);
    </pre>          
    but that is a BIG IF! of course, as i have learned after a lengthy trawl through this ng, WLS 8.1 uses its own implementation of the javax.xml.soap.* classes. in particular, weblogic's SOAPBody implementation is devoid of an addDocument(org.w3c.dom.Document) method. and SOAPBodyElement does not have an appendChild(org.w3c.dom.Node)
    please, can anybody fill me in on how to go about doing what i am trying to do using WLS 8.1's javax.xml.soap classes?
    many thanks

    if anybody else out there is also trying to do what i have described (return xml text in a soap response), the solution (told to me by my company's BEA rep) is to just add the raw xml text to the SOAPElement.addTextNode() and weblogic will do the right thing (namely, escape whatever needs to be escaped).
    i had been lead to believe that you couldn't send entity refs (<pre>< and ></pre>) in a soap response. i was told i needed to wrap my raw xml in a CDATA section. but actually i don't need a CDATA section after all for the response i need to return (xml text). contrary to what i was lead to believe by another developer, entity refs are not a problem in a soap response (according to BEA, anyway).

  • 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;

  • Confused with CDATA section

    Hi,
    I am confused as to how the DOM tree is formed for the following XML
    <Template>
    <Query>
    <sql name="A">
    <![CDATA[
    SELECT     name from salary where salary >1000;
      ]]>
    </sql>
    <sql name="B">
    <![CDATA[
    SELECT    *            FROM         EMPLOYEES
                WHERE       rownum <= 2;
      ]]>
    </sql>
    </Query>
    </Template>I want to know how the tree for the above XML is formed
    ELEMENT
    --Text
    --CDATA Element
    --Text
    I have used xpath to get a NodeList
    XPATH QUERY => Template/Query/sql
    The NodeList is passed to a function to get the sql query inside CDATA,
    This is the function I wrote
    public static void traverseCData(NodeList rootNode){
    for(int index = 0; index < rootNode.getLength();
    index ++){
    Node aNode = rootNode.item(index);
    printNodeType(aNode);
    if (aNode.getNodeType() == Node.CDATA_SECTION_NODE){
    Node firstChild = aNode.getFirstChild();
    System.out.println("FirstChild => "); printNodeType(firstChild);
    if(firstChild.getNodeType() == Node.TEXT_NODE){
    System.out.println("NodeName " + firstChild.getNodeName());
    System.out.println("Node Value " + firstChild.getNodeValue());
    System.out.println("Text Content " + firstChild.getTextContent());
    traverseCData(aNode.getChildNodes());
    Please clarify
    1) If the DOM tree for the NodeList I have assumed above is right
    2) How do I traverse the CData section above. I actually need to replace the sql query in the CDATA section with a new sql query. Can you please help me how to proceed.
    Thanks
    Kart

    1) If the DOM tree for the NodeList I have assumed above is rightI would suggest a simple test program that just dumps out the DOM structure would be the best way of finding if your assumption is true.

  • Org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x80) was found in the CDATA section

              Hi,
              I,'m using c.tld tag libraries from Yakarta in order to use c:if functions.
              When I use non-unicode characters in my JSP pages, it crashes:
              java.io.IOException: javax.servlet.jsp.JspException: The taglib validator rejected
              the page: "org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x80)
              was found in the CDATA section., "
                   at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:124)
                   at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:258)
                   at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:353)
                   at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:211)
                   at weblogic.servlet.jsp.JspStub.checkForReload(JspStub.java:149)
                   at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:521)
                   at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:351)
                   at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
                   at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5445)
                   at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:780)
                   at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3105)
                   at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2588)
                   at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
                   at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
              How can I force it to use ISO-8859-1? All my tries haven't work. What should I
              do? The c.tld libraries and jars are taken from JDK 1.4.1_02
              

    Hi Stefan,
       This is my source xml in moni..
    xmlns:prx="urn:sap.com:proxy:ECP:/1SAI/TAS5BFDF495190544E4B506:701:2008/06/06">
      <SiteId>0080</SiteId>
      <UCC>42027519 91029010015</UCC>
    My interface is SAP(Proxy) to Database(Synchronous).
       SAP (PROXY) --> PI --> DATABASE ( Synchronous Communication )
    Let me know if u need any information from my side...
    Thanks for ur help...
    Thanks,
    Siva..

  • Using javascript in PDF how to identify insatnces of field on all pages

    Hi,
    I am creating a PDF document with report kind strcuture,so that if i have a field in 1 Page (Header section ) then the field will also be there on Page 2 (Header section ) and so on for all pages.
    I am basically creating from a tool.So if i have text field on Page 1 with name 'text1' then on Page 2 it has a name say 'text1_osi21' kind.
    What i need is how to identify or get all the occurences of my desired field on all pages.
    I also tried with getField('text1.0') kind but it wont work since for the second,thrid ... instances of the field its appending a value 'osi#'.
    Also tried using 'rect' properties but we cant gurantee about the position of the desired field to remain same on all pages.
    Please help with any clue
    Thanks & Regards
    nitin

    I can do it with the word  template builderbut not with the layout editor. Is there a way to achieve the same result with the bi layout editor?

  • CDATA section in a tag of an XML file

    Hi SDNers:
    I have an issue with using the method CREATE_CDATA_SECTION of Interface IF_IXML_DOCUMENT.
    I have created an XML file from ABAP using methods in IF_IXML_DOCUMENT etc.
    The XML file is perfectly alright. But now there's a need to add CDATA section.
    I need the CDATA section as follows in XML file...
    <CustomField>
        <![CDATA[
              First Line of Text
              Second line of Text
              Third Line of Text
          ]]>
    </CustomField>
    but don't know how to program this. Can anybody help/advice me on this?
    Looking forward to your optimum response(s).
    Best Regards

    Hi SDNers:
    I have an issue with using the method CREATE_CDATA_SECTION of Interface IF_IXML_DOCUMENT.
    I have created an XML file from ABAP using methods in IF_IXML_DOCUMENT etc.
    The XML file is perfectly alright. But now there's a need to add CDATA section.
    I need the CDATA section as follows in XML file...
    <CustomField>
        <![CDATA[
              First Line of Text
              Second line of Text
              Third Line of Text
          ]]>
    </CustomField>
    but don't know how to program this. Can anybody help/advice me on this?
    Looking forward to your optimum response(s).
    Best Regards

  • Using XQuery to filder CDATA section

    How do I filter value inside CDATA section using XQUERY in SELECT statement?
    I am using value function.
    <DomainConfig>
         <typeOfDBConnection>
               <![CDATA[#MS SQL]]>
         </typeOfDBConnection>
    </DomainConfig>

    declare @x xml = '<DomainConfig>
    <typeOfDBConnection>
    <![CDATA[#MS SQL]]>
    </typeOfDBConnection>
    </DomainConfig>
    select
    ltrim(rtrim(replace(replace(replace
    (@x.value ('(/DomainConfig/typeOfDBConnection/text())[1]', 'varchar(100)') , char(10), ''), char(13), ''), char(9), '')
    Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com

  • 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>

  • How to identify XML gateway patch version in R12 ?

    Hi,
    how to identify XML gateway patch version in R12.1.3? Which is the latest version available for R12.1.3
    Regards

    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> @ecxver.sql
    ECX_UTL_XSLT_DIR Profile :
    /usr/tmp
    ECX_OAG_LOGICALID Profile :
    ECX_SERVER_TIMEZONE Profile:
    ECX_SYS_ADMIN_EMAIL Profile:
    ECX_XML_VALIDATE_FLAG Profile: Y
    ECX_XML_MAXIMUM_SIZE Profile : 2000000
    utl_file_dir :
    /usr/tmp, /usr/tmp,
    /busdata/dfop/nca1/db/tech_st/11.1.0/appsutil/outbound/dfopnca1_oncerpd4,
    /usr/tmp, /busdata/dfop/nca1/db/tech_st/11.1.0/ccr/state
    Oracle XML Developers Kit 11.1.0.7.0 - Production
    Parser Version Ok
    XML Gateway Status Summary
    XML Parser Version OK
    All ECX Objects Valid? OK
    All XML Parser Objects Valid? OK
    OTA Running? N/A*
    Total Messages on Outbound Queue 0
    OTA Msgs on Outbound Queue 0
    Others Msgs on Outbound Queue 0
    Messages on Inbound Queue 0
    *Please use the ECXOTAPing.html as described in the Testing Oracle Transport
    Agent section of the User's Guide
    End of Summary
    Service Component Control Event Subscriptions
    EVENT_NAME RULE_FUNCTION OUT_AGENT STATUS
    oracle.apps.ecx.inbound.message.process [email protected]. MICHELIN.COM Not Defined ENABLED
    oracle.apps.ecx.inbound.message.process [email protected] N.COM Not Defined ENABLED
    oracle.apps.ecx.inbound.message.receive [email protected] N.COM Not Defined ENABLED
    oracle.apps.ecx.inbound.message.receive CLN_XMLG_EVENT_HANDLER_PKG.CLN_XMLG_SET [email protected] Not Defined ENABLED
    NC.MICHELIN.COM
    oracle.apps.ecx.inbound.message.receive CLN_XMLG_EVENT_HANDLER_PKG.CLN_XMLG_EVE [email protected] Not Defined ENABLED
    .MICHELIN.COM
    oracle.apps.ecx.inbound.message.receive CLN_XMLG_EVENT_HANDLER_PKG.CLN_XMLG_EVE [email protected] Not Defined ENABLED
    .MICHELIN.COM
    oracle.apps.ecx.inbound.message.receive [email protected]. MICHELIN.COM Not Defined ENABLED
    oracle.apps.ecx.processing.message.callb [email protected] LIN.COM Not Defined ENABLED
    ack
    oracle.apps.ecx.processing.message.error CLN_XMLG_EVENT_HANDLER_PKG.CLN_XMLG_PRO CESSING_ERROR_F@DFOPN Not Defined ENABLED
    CA1.ONC.MICHELIN.COM
    oracle.apps.ecx.processing.message.error [email protected] LIN.COM Not Defined ENABLED
    oracle.apps.ecx.processing.message.error [email protected] LIN.COM Not Defined ENABLED
    oracle.apps.ecx.processing.message.error [email protected] N.COM Not Defined ENABLED
    oracle.apps.ecx.processing.notification. [email protected] LIN.COM Not Defined ENABLED
    send
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64 bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    Regards

  • CDATA sections converted to text nodes by XMLDOM parser

    I have done a lot of reading, experimentation and openned a TAR on this. I am suprised nobody else has posted on the issue. The xmlparser.parseClob call appears to parse an XML document properly but converts CDATA sections into text nodes.
    For example take the following XML:
    <some><pnode><![CDATA[the <xml>]]></pnode></some>
    If I immediately write it back out using xmldom.writeToClob the resulting XML will be:
    <some>
    <pnode>the &amp;#60;xml></pnode>
    </some>
    For one I wish writeToClob wouldn't add whitespace (but that's another issue), but as you can see the CDATA node no longer exists, being replaced by an encoded text node.
    I wrote code to traverse the DOM outputting node types and even writing a similar printer to the writeToClob. The fact is there really is no CDATA node in the DOM after parsing. Instead the code which traverses the DOM identifies a single text node with CDATA text contained in it.
    In my opinion this is extremely odd default behavior and I cannot seem to work around it due to the fact that the DOM structure is not created properly by the parse. Please tell me that other people have ran into this behavior and I'm not just nuts? Better yet, please just tell me I'm doing something wrong and you have the answer...that would be kinder to my project schedule.
    If you like I have example code. I am using the xmldom API on Oracle 9.2.0.4.

    Thanks for the response Mark. I have gotten some feedback from my TAR as well. We are using version 9.2.0.*. I have since learned that this is a bug in the xmldom implementation based on Java. It has been recommended that I use the dbms_* packages as you suggested. I originally attempted to use the dbms_* packages (the C-based implementation) when following the tutorials and other documentation but for some reason we do not seem to have those packages installed. I was directed by my DBA's to use the other package as we both bevelieved it was just the same package in a different location. I am working with my DBA to get the C-based dbms_* packages installed.

  • How to identify the locks in oracle db objects? i dont have access to check

    How to identify the locks in oracle db objects? i dont have access to check the v$lock or v$ objects. i dont have dba access. what are the symptoms for table, row or objects lock? how v guess it would be lock?
    Thanks in advance friends..

    I believe you will have to call your DBA on the phone in that case.
    You can query something with a select ... for update nowait.
    If it raises an exception you can handle it within a when section.
    -- Running in one session
    SQL> create table t1 as select 1 col1 from dual;
    Table created
    SQL> select * from t1 for update nowait;
          COL1
             1
    SQL>
    -- now running in a different session
    SQL> select * from t1 for update nowait;
    select * from t1 for update nowait
    ORA-00054: resource busy and acquire with NOWAIT specified
    SQL> set serveroutput on
    SQL>
    SQL> DECLARE
      2    CURSOR cur1 IS
      3      SELECT col1 FROM t1 FOR UPDATE NOWAIT;
      4    v_col1 NUMBER;
      5    locking_error EXCEPTION;
      6    PRAGMA EXCEPTION_INIT(locking_error, -00054);
      7  BEGIN
      8    OPEN cur1;
      9  EXCEPTION
    10    WHEN locking_error THEN
    11      dbms_output.put_line('Busted locking my rows!');
    12  END;
    13  /
    Busted locking my rows!
    PL/SQL procedure successfully completed
    SQL> Now, surely you won't be able to tell anything else other than there was something locked there.
    But none of the details you would find in the views.

  • An invalid XML character (Unicode: 0x19) was found in the CDATA section.

    First my declaration in the xml file was:
    <?xml version="1.0" encoding="UTF-8"?>
    Then since the error(Exception:java.io.UTFDataFormatException: invalid byte 2 of 2-byte UTF-8 sequence (0x3f)) resulted for "�", I changed it to:
    "<?xml version="1.0" encoding="ISO-8859-1"?>"
    Now for some cases I have an error:
    Exception:org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x19) was found in the CDATA section.
    What do I do NOW?
    What wrong have I been doing in the past?
    How could I make sure that no such encoding errors result?
    Thanking you in anticipation,
    Cheers

    Possibly got some invalid non-printing character in there somewhere... possibly as a result of conversion between platforms etc. Or you are parsing a file that was encoded using a totally different character set to the ones you're attempting to read it with. What originally created the XML file you are trying to parse?

  • How to identify relevant BADIs to hide a screen field from specific users

    We have a business requirement to hide a document item field (BSEG-XREF3) from specific users (i.e make the field invisible if the userid does not exist in a Z table) during FI invoice entry/maintenance/display via transactions FB01, FB02, FB03, FV50, FV60, FBV0, etc..  We know that it would be possible to do this via modification to the Process Before Output sections of LF040O00, LFDCBFM0, MF05AO00_DYNPRO_MODIFIZIEREN, MF05LO00, but would prefer to avoid modification if possible. 
    I believe that BADIs could possibly be used for screen enhancements, but have not had any previous exposure to BADIs, so I'm really not sure whether it's possible to use BADIs for our specific requirement.  For example, using the advice given in the 2nd post in thread BADI for contract, I've searched SAPMF05A for all 'CALL METHOD cl_exithandler=>get_instance' statements, and have found that a single BADI (FBAS_CIN_MF05AFA0 - EWT - Downpayment Clearing - Tax transfer for CIN) seems to exist for FB01.  The description of this BADI sounds completely inappropriate for our requirement.  However, subsequent posts in that thread suggest far more BADIs for the relevant transaction than were given when searching the ABAP for all 'CALL METHOD cl_exithandler=>get_instance' statements, so I'm not convinced that the procedure I'm following will provide me with all the relevant BADIs for the transaction.
    Please can you advise me how to identify which BADIs - if any - can be used to control screens before output for FB01 screen SAPMF05A/332 (SAP R/3 4.6C)? 
    Many thanks in anticipation,
    Jules

    Hi Kuntal,
    Thank you very, very much for your prompt response and very useful alternative suggestion.
    The screen variant solution would be invaluable under different circumstances, but would be too complex to administer for this particular issue because we're trying to hide the field from unauthorised users in over 100 invoice entry/maintenance/display transactions. 
    We can make a Process Before Output modification to 4 SAP standard programs (LF040O00, LFDCBFM0, MF05AO00_DYNPRO_MODIFIZIEREN, MF05LO00) to make the field invisible for unauthorised users (i.e. whose user-ids are not in a Z* table), but would prefer to avoid modification if we could use BADIs instead.  You've said that you're not sure how we can identify the relevant BADIs, but I very much appreciate the suggestion you've made anyway - it might be useful to others who find themselves in a similar situation for a more limited number of transactions.
    Please can someone advise me how to identify which BADIs - if any - can be used to control screens before output for FB01 screen SAPMF05A/332 (SAP R/3 4.6C)?
    Many thanks,
    Jules

Maybe you are looking for