CDATA

hello
i have a problem with parsing a CDATA inside XML
SELECT t.EXTRACT('//COMMENT/text()') .GETSTRINGVAL()  COMMENT
INTO COMMENT_TEST
FROM TABLE(XMLSEQUENCE(EXTRACT(ac_XML_INPUT, '/RECSET/REC'))) t;I have
<RECSET>
      <REC>       
          <COMMENT><![CDATA[order number: [order number] [info] - text?]]></COMMENT>
      </REC>
</RESCET>              How i can parse this CDATA code to insert it to table as text "order number: [order number] [info] - text?"
Thanks,
Samm.

If there is only one COMMENT element under every REC element then use extractValue(),
however, if not, then use xquery to join the comments into one row
SQL> with t as (select
  2    xmltype('<RECSET>
  3              <REC>
  4               <COMMENT><![CDATA[order number: [order number] [info] - text?]]></COMMENT>
  5               <COMMENT><![CDATA[order number: [order number] [info] - SECOND text?]]></COMMENT>
  6              </REC>
  7              <REC>
  8               <COMMENT><![CDATA[order number: [order number] [info] - 2 text?]]></COMMENT>
  9               <COMMENT><![CDATA[order number: [order number] [info] - 2-SECOND text?]]></COMMENT>
10              </REC>
11             </RECSET>') ac_xml_input from dual)
12  select xv.*
13  from t
14      ,xmltable('for $i in /RECSET/REC return fn:string-join(($i),'''')'
15          passing t.ac_xml_input
16          columns com varchar2(4000) path '.') xv;
COM
order number: [order number] [info] - text?order number: [order number] [info] - SECOND text?
order number: [order number] [info] - 2 text?order number: [order number] [info] - 2-SECOND text?
SQL>

Similar Messages

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

  • CDATA in the soap receiver adapter ?

    Hi Guys,
    I am passing the whole xml into a string on the target side, i did java mapping and on the receiver side system the CDATA is not recognised. Is there any way i can eliminate this cdata ?
    <?xml version="1.0" encoding="utf-8" ?>
    - <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    - <soap:Body>
    - <C_XML xmlns="http://bradtest.velsol.com/">
    - <sXML>
    - <![CDATA[ "<?xml version="1.0" encoding="UTF-8" ?><DEBMAS02><IDOC BEGIN="1"><EDI_DC40 EGMENT="1>00000000</DBMON></E1KNKKM></E1KNA1M></IDOC></DEBMAS02>"
      ]]>
      </sXML>
      </C_XML>
      </soap:Body>
      </soap:Envelope>
    any help would be appreciated, how to eliminate the CDATA
    Thanks,
    Raj
    Message was edited by:
            raj reddy

    Hi
    The deleteData() method deletes data from a CDATA node.
    <b>Syntax</b>
    CDATANode.deleteData(start,length)
    <b>Please try following code</b>
    xmlDoc=loadXMLDoc("books_cdata.xml");
    var x=xmlDoc.getElementsByTagName("html")[0].childNodes[0];
    x.deleteData(0,3);
    document.write(x.data);
    For more help go through following link
    <b>http://www.w3schools.com/dom/met_cdata_deletedata.asp</b>
    Thanks
    Abhishek Mahajan
    ***Please Reward points if find helpful****

  • SAP GRC NF-e 10.0: Erro na interface NFB2B_procNFe_IB (contendo CDATA)

    Olá a todos.
    Poderiam por gentileza me ajudar com a questão abaixo?
    Estou com o seguinte problema na interface NFB2B_procNFe_IB do SAP GRC NF-e 10.0 (Support Package 15):
    Recebemos uma série de XML's de montadoras de automóveis que contém informações adicionais nas tags <infAdProd> e <infCpl>, como por exemplo:
      <infAdProd>VLR. PIS R$ 6,81 VLR. COFINS R$ 31,44<![CDATA[<ID ITEM=005115/><PED=4500159772/> <UM=PC/>]]></infAdProd>
    Porém ao inserir essa mensagem na interface NFB2B_procNFe_IB, a interface interpreta da seguinte forma:
        <infAdProd>VLR. PIS R$ 6,81 VLR. COFINS R$ 31,44
          <![CDATA[
            <ID ITEM=005115/>
            <PED=4500159772/>
            <UM=PC/>]]>
            </infAdProd>
    Sendo assim, ocorre o erro abaixo:
    <nm:ExchangeFaultDataExt xmlns:nm="http://sap.com/xi/NFE/common" xmlns:prx="urn:sap.com:proxy:NED:/1SAI/TAS8DFA2846CCAA9B6570C6:702">
      <faultText>Erro durante a transformação: Fim de elemento '{http://www.portalfiscal.inf.br/nfe}infAdProd' esperado programa: /1SAI/SAS6F90159886715E7C4560 caminho: nfeProc(1)NFe(1)infNFe(1)det(4)infAdProd(3)ID(1)</faultText>
      </nm:ExchangeFaultDataExt>
    Sei que temos algumas opções como:
    1. Alterar o XML no mapping do PI; (Funcionaria com mensagens processadas através do PI, mas não conseguiria inserir um XML manualmente via SE80)
    2. Alterar o XML no ABAP ao executar a classe /XNFE/CL_006NFB2B_PROC_NFE_IB; (Fazer algum replace nesses caracteres "<" e ">" por "&lt;" "&gt;"
    Mas como fazer isso sem danificar a assinatura do XML que já está assinado e autorizado na SEFAZ?
    Existe alguma nota SAP para corrigir esse problema?
    Agradeço desde já a atenção.
    Rodrigo Costa.

    Felipe,
    também tive o mesmo problema do lado do NTB2B_procNFe_OB. Tentei de várias formas transformar o XML para ficar aderente ao cliente, porém o PI sempre alterava o XML (possivelmente devido ao encoding).
    Vi muitos posts sobre o tema, mas ainda quando era o GRC NF-e 1.0, com a assinatura no Java. Para o GRC 10.0 não funciona, pois quando o xml chega no PI, o mesmo já está assinado, portanto não se pode alterar nada.
    A solução foi para nesses casos específicos enviar o xml através do ECC mesmo.
    Mas para o NFB2B_procNFe_IB ainda sem solução.
    Abs.
    Rodrigo.

  • object is not working in CDATA in XML with flash

    hi, in my xml file I use CDATA to insert html code. I have put <object >.. .some flash movie file. .. . </object>. But in front end , I did not get any video played. Why <object> html element does not support + what would be next solution to show my you tube vidoe file.. Thanks for taking interest on this issue.

    what are you doing with the string "<object>...some flash movie...</object>"?

  • Newbie, Please help, How do I add CDATA to exsting xml flash asset

    Hi, I am a front end web designer/developer and
    analyst...struggling with putting an accordian flash xml menu
    together. I have it done except I need to add a simple trademark
    symbol circle with r. I am struggling with how to do this since I
    am not savvy in actioncript. I assume the best way is to add it is
    with a CDATA child node, but do not know how or whatever is the
    best way to get this done since am on a tight deadline. I need
    someone to explain step by step what I have to do to get this
    simple addition resolved. Attached are the links to home page and
    code for the xml file. The left navigation is the asset that I need
    to add the trademark symbol under about, about ADHERE. Thanks so
    much in advance!!!!!!
    [URL=http://www.nodcreative.com/natrecor_sliced/natrecor_index.html]index
    page with flash xml menu asset[/URL]
    xml code:
    <?xml version="1.0" encoding="UTF-8"?>
    <accodion>
    <item name="HOME">
    </item>
    <item name="ABOUT">
    <item name= "ABOUT
    ADHERE<![CDATA[write]]>"></item>
    <item name="Medical Information" url="
    http://www.jnj.com?ref=Random">
    </item>
    <item name="About SCIOS" url="
    http://www.jnj.com?ref=Random">
    </item>
    </item>
    <item name="INTERACTIVE DOSING INFORMATION">
    <item name="Indications and Usage" url="
    http://www.jnj.com?ref=Random"></item>
    <item name="Contraindications" url="
    http://www.jnj.com?ref=Random"></item>
    <item name="Warnings" url="
    http://www.jnj.com?ref=Random"></item>
    <item name="Dosage and Administration" url="
    http://www.jnj.com?ref=Random"></item>
    </item>
    <item name="RESOURCES AND TOOLS">
    <item name="NATRECOR PI" url="
    http://www.jnj.com?ref=Random"></item>
    <item name="About Heart Failure" url="
    http://www.jnj.com?ref=Random"></item>
    <item name="Stages of Heart Failure" url="
    http://www.jnj.com?ref=Random"></item>
    <item name="NATRECOR Dosing Information" url="
    http://www.jnj.com?ref=Random"></item>
    <item name="Patient Management Resources" url="
    http://www.jnj.com?ref=Random"></item>
    </item>
    <item name="US PRESCRIBING INFORMATION">
    </item>
    <item name="IMPORTANT SAFETY INFORMATION
    ref=http://www.jnj.com">
    </item>
    <item name="REGISTRATION ref=http://www.jnj.com">
    </item>
    </accodion>
    FLASH actionscript is as follows:
    // The accordion
    var accordion = this
    // The item list
    var itemList = []
    // SETTINGS
    //-------------PROPERTIES----------------
    // Separation between the buttons
    var separation = 1.5
    // Tabulation between the buttons and the margin
    var tabulation = 10
    // if true, it cant be more than one items opened at the same
    time (only for the first buttons, POWERFUL, MENU ,ACCORDION, ets).
    var autoClose = true
    // if true, it cant be more than one subItems opened at the
    same time.
    var subItemAutoClose = true
    // if true, open and close all the subItems at the same time.
    var openAll = false
    // The height of the button
    var itemHeight = 21
    // The width of the button
    var itemWidth = 230
    // If true, show the light over the button
    var light = true
    // The ease of the menu opening
    var openEase = 2.5
    // The ease of the menu closing
    var closeEase = 2.5
    // The rollOut color fade speed
    var rollOutFade = 8
    //-------------COLORS----------------
    // The color of the button
    var buttonColor = 0xa
    // The roll over color
    var rollOverColor = 0xCCCCCC
    // The arrow color
    var arrowColor = 0xCCCCCC
    // The arrow color on roll over
    var rollOverArrowColor = 0x000000
    // The text color
    var TextColor = 0xFFFFFF
    // The text color on roll over
    var rollOverText = 0x000000
    // LOADING XML
    // The xml data
    var xmlSource:XML = new XML
    // Loading the xml
    xmlSource.onLoad = function(success:Boolean):Void {
    // When the load finishs...
    if (success) {
    // The first node of the xml
    xmlRoot = xmlSource.firstChild
    // The item nodes
    xmlItems = xmlRoot.childNodes
    // The total of items
    total = xmlItems.length
    // Creating the buttons
    for (i=0; i<total; i++){
    // Attaching the buttons
    accordion.attachMovie("item", "item" + i, i)
    // The button reference
    itemList
    = accordion["item"+i]
    // The first node of the item node
    itemList.xmlRoot = xmlItems
    // The separation between subitems
    itemList.separation = separation
    // Tabulation between the subitems and the margin
    itemList
    .tabulation = tabulation
    // subItems auto close
    itemList.subItemAutoClose = subItemAutoClose
    // The subitems height
    itemList
    .itemHeight = itemHeight
    // The subitems width
    itemList.itemWidth = itemWidth
    // shows/hides the subitems light
    itemList
    .light = light
    // The subitems color
    itemList.buttonColor = buttonColor
    // The roll over color
    itemList
    .rollOverColor = rollOverColor
    // The arrow color
    itemList.arrowColor = arrowColor
    // the arrow color on roll over
    itemList
    .rollOverArrowColor = rollOverArrowColor
    // The text color
    itemList.TextColor = TextColor
    // The roll over text color
    itemList
    .rollOverText = rollOverText
    // the opening easing
    itemList.openEase = openEase
    // The closing easing
    itemList
    .closeEase = closeEase
    // The roll over fade speed
    itemList.rollOutFade = rollOutFade
    // open all
    itemList
    .openAll = openAll
    // ignore white
    xmlSource.ignoreWhite = true;
    // Loads the .xml file
    xmlSource.load("accordion.xml");
    // Aligning the items each one below the other
    this.onEnterFrame=function(){
    // Does the align to ALL the items
    for (i=1; i<total; i++){
    // Aligning the items
    itemList._y = itemList[i-1]._y +
    itemList[i-1].mask._height + itemList[i-1].button._height +
    separation
    // The cursor position
    cursor._x = _xmouse
    cursor._y = _ymouse
    // Opens the items
    onMouseDown = function (){
    // Does this to all the buttons
    for (i=0; i<total; i++){
    // If is clicked
    if (itemList
    .button.hitTest(cursor)){
    // Shows the current item
    showCurrent(itemList)
    // Shows the button clicked
    showCurrent=function(current){
    // Does this to all the buttons
    for (i=0; i<total; i++){
    // Does this to all the buttons exept the clicked
    if (itemList
    !=current){
    // Close the other items if autoclose = true
    if (autoClose){
    // Close the other items
    itemList.openBox=false
    // fades the roll over effect of the other items
    itemList
    .over = false
    //Does this to the clcked item only
    } else {
    // If it has sub items
    if (total>0){
    //Hides them if its open
    if (itemList.openBox){
    itemList
    .openBox=false
    //Shows them if its closed
    } else {
    itemList.openBox=true
    // If it has no subitems goes to the link
    } else {
    getURL(xmlRoot.attributes.url, _self)

    Please don't cross-post in multiple forums. I have answered
    this in your other thread.

  • Sending command apdu with a byte array as CDATA

    Hi,
    I am learning java card as part of my final year project. So far I think I can do most of the basic things but I have got stuck at one particular point.
    I know that there are different constructors for creating a command apdu object and a number of these constructors take an array of bytes as CDATA values.
    My problem is, how to access this array of data in the card side because apdu.getBuffer() returns an array of integers (bytes)? And what is actually on apdu.getBuffer()[ISO7816.OFFSET_CDATA)] location when you send command apdu object using such a constuctor?
    regards
    Edited by: 992194 on 06-Mar-2013 06:12

    992194 wrote:
    (..) I should have mentioned earlier that my card use jc 2.2.1 version, and i have read from different places that this version does not support ExtendedLength facility.Indeed.
    Also I understand the semantics of apdu.getBuffer()[ISO7816.OFFSET_CDATA] that is the first byte of the command data. My question is, this command data was initially supplied as an array of bytes. Something like this:
    +new CommandAPDU(CLA, INS, P1, P2, DATA_ARRAY, Le)+
    So when you call:
    byte [] buffer = apdu.getBuffer()
    So does this mean that the byte values inside DATA_ARRAY automatically occupy locations +buffer[ISO7816.OFFSET_CDATA]+ onwards inside the buffer?Yes. The length would be<tt> (short)(buffer[ISO7816.OFFSET_LC]&0xFF) </tt>. Notice the<tt> &0xFF </tt> is a must above 127 bytes.
    Or their is a mechanism of extracting the DATA_ARRAY array itself?No.
    In fact, in the interest of performance and portability in environments with little memory, the usual coding style is to pass<tt> buffer </tt>, an offset within that, and the length; rather than making an object, which would require a copy. Welcome to the real world of Java Card.

  • Reading the data from CDATA.

    > Now XSLT ignores all the data in CDATA and i get nothing in output.  
    This is correct behaviour:
    http://www.w3.org/TR/2008/REC-xml-20081126/#sec-cdata-sect
    there is nothing that you can do here.

    The first code snippet in my post is a code from : "source text view " .
    The Test XML entered by me was
    <catalog>
         <cd>
              <title>Empire Burlesque</title>
              <artist>Bob Dylan</artist>
              <country>USA</country>
              <company>Columbia</company>
              <price>10.90</price>
              <year>1985</year>
         </cd>
         <cd>
              <title>Empire Burlesque2</title>
              <artist>Bob Dylan2</artist>
              <country>USA</country>
              <company>Columbia2</company>
              <price>10.90</price>
              <year>1985</year>
         </cd>
    <cd>
              <title>Empire Burlesque3</title>
              <artist>Bob Dylan3</artist>
              <country>USA</country>
              <company>Columbia3</company>
              <price>10.90</price>
              <year>1985</year>
         </cd>
    </catalog>
    Do you wanna point out that the PI will not add CDATA in real scenario??
    I have not configured complete scenario as sender system is not yet ready to send data.

  • Problem retrieving Data from a CDATA-Section using XMLDOM

    Hello,
    Ware: Oracle 8.1.7.4 64bit, XDK for PL/SQL Version 9.2.0.3, Solaris8 64bit
    I can't retrieve Data from the CDATA-Section of an XML-String, neither with
    getData(DOMCharacterData) or substringData. Also getLength fails. I get always
    the following error:
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception: java.lang.ClassCastException
    ORA-06512: at "XML_SCHEMA.XMLCHARDATACOVER", line 0
    ORA-06512: at "XML_SCHEMA.XMLDOM", line 853
    ORA-06512: at "SCHWABE.XML_TEST", line 47
    ORA-06512: at line 1
    I can successfully cast the DOMNode to a CharacterData with makeCharacterData
    and check with isNull (DOMCharacterData) (returns FALSE).
    My Testcase:
    1) A Function which build a XML-Document:
    CREATE OR REPLACE FUNCTION XML_ResponseCalc RETURN VARCHAR2 IS
    doc VARCHAR2(32767);
    BEGIN
    doc :=
    '<?xml version="1.0" encoding="UTF-8"?>
    <RSDecEng>
    <Version>1.00</Version>
    <ResponseCalc>
    <ID>00000000000000000014</ID>
    <Burst>
    <Definition>
    <Count>1</Count>
    <ID>
    <Start>1</Start>
    <Length>4</Length>
    </ID>
    <Var>
    <Name>Risiko_1</Name>
    <Start>5</Start>
    <Length>5</Length>
    </Var>
    </Definition>
    <Data>
    <Length>9</Length>
    <Count>5</Count>
    <![CDATA[
    1 0.001
    2 0.002
    3 0.003
    4 0.004
    5 0.005
    6 0.006
    7 0.007
    8 0.008
    9 0.009
    10 0.010
    ]]>
    </Data>
    </Burst>
    </ResponseCalc>
    </RSDecEng>
    2) The Procedure which parses the XML-Document (no Exception-Handling):
    CREATE OR REPLACE PROCEDURE XML_TEST IS
    Parser XML_SCHEMA.XMLParser.Parser;
    DOMDocument XML_SCHEMA.XMLDOM.DOMDocument;
    DOMNode XML_SCHEMA.XMLDOM.DOMNode;
    DOMNodeItem XML_SCHEMA.XMLDOM.DOMNode;
    DOMNodeList XML_SCHEMA.XMLDOM.DOMNodeList;
    DOMCharacterData XML_SCHEMA.XMLDOM.DOMCharacterData;
    TheDocument CLOB;
    ID VARCHAR2(100);
    Data VARCHAR2(200);
    BEGIN
    -- LOB
    DBMS_LOB.CREATETEMPORARY(TheDocument, TRUE);
    DBMS_LOB.WRITEAPPEND(TheDocument, LENGTH(XML_ResponseCalc), XML_ResponseCalc);
    -- Parse
    Parser := XML_SCHEMA.XMLParser.NewParser;
    XML_SCHEMA.XMLParser.ParseCLOB(Parser, TheDocument);
    DOMDocument := XML_SCHEMA.XMLParser.GetDocument(Parser);
    XML_SCHEMA.XMLParser.FreeParser(Parser);
    -- Node
    DOMNode := XML_SCHEMA.XMLDOM.MakeNode(DOMDocument);
    -- Get ID
    DOMNodeList := XML_SCHEMA.XSLProcessor.SelectNodes
    (DOMNode,'/RSDecEng/ResponseCalc/ID/text()');
    IF XML_SCHEMA.XMLDOM.GetLength(DOMNodeList) > 0 THEN
    DOMNodeItem := XML_SCHEMA.XMLDOM.Item(DOMNodeList, 0);
    XML_SCHEMA.XMLDOM.WriteToBuffer(DOMNodeItem, ID);
    SYS.DBMS_OUTPUT.PUT_LINE ('ID: '||ID);
    END IF;
    -- Get CDATA
    DOMCharacterData := XML_SCHEMA.XMLDOM.MakeCharacterData(DomNode); -- <-- ok here...
    IF NOT XML_SCHEMA.XMLDOM.isNull (DOMCharacterData) THEN -- <-- ...and here
    Data := XML_SCHEMA.XMLDOM.GETDATA(DOMCharacterData); -- <-- ...but here Exception raise
    END IF;
    END;
    I hope you can help me.
    Thank you in advance
    Markus Schwabe

    You need to notice the definitions for makecharacterdata:
    FUNCTION makeCharacterData(n DOMNode) RETURN DOMCharacterData;
    PURPOSE
    Casts given DOMNode to a DOMCharacterData
    It only do the casting.

  • EntityEncodeStrings and Internet Explorer w/ CDATA in XML

    Hello.
    I'm makin a sort of content management system which fetches
    data from an XML file:
    (pages.xml)
    <pages>
    <page id="1">
    <title>Home</title>
    <link>#1</link>
    <content><![CDATA[<h3>Welcome"</h3><p>We're
    experimenting a lot with different stuff on this page, please bare
    with us.</p>]]></content>
    </page>
    <page id="2">
    <title>About</title>
    <link>#2</link>
    <content><![CDATA[<h3>about</h3>Woah,
    hold it there, punk.]]></content>
    </page>
    [etc...]
    </pages>
    My XHTML-file has this in the header:
    var nav = new Spry.Data.XMLDataSet("/pages.xml",
    "pages/page");
    nav.setColumnType("@id", "number");
    nav.setColumnType("content", "html"); // skips entity
    encoding \o/
    I want to display everything in the <content />-xml
    tree as (X)HTML
    With the code I have everything works perfectly in Firefox,
    but in Internet Explorer (7) I'm getting no data at all because of
    entityEncodeStrings not functioning correctly (or so it seems). If
    I remove this it displays in both Firefox and Internet Explorer
    (though with the entities encoded).
    It doesn't matter which way I do it, using the option
    entityEncodeStrings: false or -1 I get the same (non-)results.
    I'm very thankful for any help!

    http://labs.adobe.com/technologies/spry/samples/data_region/XMLDataSetStringHandlingSample .html

  • OSB: Strip CDATA while sending to email

    Hi
    My idea is user will receive html in his email with our dynamic text via OSB 11g.
    I am sending an HTML code through OSB email.
    HTML file has a template.
    I insert dynamic text (text+xml actually) at a specific location in HTML.
    business service has input type = text, output type = none and protocol is email. Content-Type of business service is changed to "text/html" at run time by replace action for transport header in Route action.
    Issue is: In mail, in message body intial tags of dynamic text is missing and I can see find ]]> at the end in my email message body. When I right click on received HTML and click on "view source", I see <![CDATA and ]]> encapsulates my dynamic text.
    I can not see <![CDATA and ]]> in my message flow though it must exist since when I tried fn-bea:serialize() with email body content OSB gave me error of unbalanced tag metadata for <![CDATA.
    Is there a way to strip <![CDATA and ]]> ?? I don't wish my end user to see ]]> in message body.
    Thanks and Regards
    Swapnil Kharwadkar

    I think the below function will do the job,
    If the InputString=<![CDATA[        
          <AddressLine1>UNIT 21 WINDSOR PARK</AddressLine1>
          <AddressLine2>50 WINDSOR AVENUE</AddressLine2>
    fn-bea:inlinedXML($InputString)
    wll provide out put as
    Simple XML tag
    +<?xml version="1.0" encoding="UTF-8" ?>+
    +<AddressLine1>UNIT 21 WINDSOR PARK</AddressLine1>+
    +<AddressLine2>50 WINDSOR AVENUE</AddressLine2>+
    Please let me know, how you go.
    Thanks,
    Vijay

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

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

  • Creation of CDATA with message mapping

    Hello all,
    Is everyone absolutely sure that a cdata string cannot be created in the middle of an xml file using message mapping? 
    I have tried doing the XSL map in other blogs I even tried writing a whole XSL map in xml spy - yet xi complains about not finding this class file and that class file.  I'm having a hard time believing that this is so hard to do in XI - especially when Microsoft web service implementation seem to long for data crammed into a string ( in my experience ).
    Any help is GREATLY appreciated.
    Thank you!!!
    Scott

    Hi Scott,
             Pls follow the following steps to insert XML string into a single element:
    Create a xsl file with the following data:
    <?xml version='1.0' ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" <i><b>NSpace</b></i>>
    <xsl:template match="/">
    <namespace:name1>
    <xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[]]></xsl:text><xsl:copy-of select="<b>//namespace:name</b>"/><xsl:text disable-output-escaping="yes"><![CDATA[]]]]></xsl:text><xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text>
    </namespace:name1>
    </xsl:template>
    </xsl:stylesheet>
    In the above code I have removed xmlns:p2="http://frik.bcc.com.pl" which is not needed.
    Also you have to put '<b>//</b>' before the target element from where you want to start creating XML string over here it is <b>name</b>. And <b>name1</b> is the element you want to store the XML string in.
    So anything in the element <b>name</b> will be stored in <b>name1</b>
    Regarding the <b>namespace:</b> To find out the namespace test your message mapping between the source and the target without adding XSLT mapping. After testing click on <b>'SCR'</b> tab present on top of the target window. There you will see <b>ns1: or ns2:</b> attached to each element. Replace <b>namespace</b> in the above code with <b>ns1: or ns2:</b>.  And replace <b>NSpace</b> in the above XSL Header with the namespace in the SCR of test map.
    So the final XSL file will look like that:
    <?xml version='1.0' ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" <i><b>xmlns:ns1="http://sap.com/xi/HR"</b></i>>
    <xsl:template match="/">
    <<b>ns1:</b>name1>
    <xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[]]></xsl:text><xsl:copy-of select="<b>//ns1:name</b>"/><xsl:text disable-output-escaping="yes"><![CDATA[]]]]></xsl:text><xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text>
    </<b>ns1:</b>name1>
    </xsl:template>
    </xsl:stylesheet>
    Dont forget to put '//' before the target element.
    This should work. Or pls put the source and target xml struct and we will assist you further.
    Regards,
    Ashish

  • How to represent ']] ' value in CDATA

    In the following CDATA representation, I want to represent ']]' value. How to represent? Any pointers will be appreciated.
    <![CDATA[  someString   ]]>

    Sorry to disappoint u, but it's not possible to mention ']]' inside a cdata section..
    Instead u can try some other value which represents ']]' inside the section and change it once rendering starts..

  • What's wrong with my CDATA entry?

    I've succesfully used CDATA in XML for other parts of my site, but have encountered a problem when trying to add a new section using the Bridge CS4 gallery.
    I'd like to replace the <siteTitle> and <groupTitle> with logos and links, but the browser (Firefox 3.5) ignores the CDATA code and shows only the text:
    <siteTitle>Homegroan Photography<![CDATA[<a href="http://www.aldidesign.com/index.html"><img src="ALDI_Logo_rev.jpg" border='0' alt='ALDI Design'</a>]]></siteTitle>
                <groupTitle>ALDI Design<![CDATA[<a href='http://www.aldidesign.com/index.html'><img src='ALDI_Logo_rev.jpg' border='0' alt='ALDI Design'</a>]]></groupTitle>
    I'm not a programmer, and would like to know if I'm doing something obviously wrong.
    Any help would be much appreciated.
    AL

    Unfortunately this won't work because the output is from Bridge CS4 and I've no idea what I'm doing. If you take a quick look at our webiste at: www.aldidesign.com and look in the "Foto" section, you'll see what I've done using the photo gallery example and some experimentation.
    I include part of the relevant XML file below:
    <photo
    path = "1.jpg"
    title = ""
    width = "300"
    height = "388"
    thumbpath = "1s.jpg"
    thumbwidth = "25"
    thumbheight = "25">
    <note>This photo is available on <![CDATA[<a href='http://www.istockphoto.com/file_search.php?action=file&username=ALDIdesign' target='_blank'><img src='88x20_blu.gif' border='0' alt='View ALDI Design Portfolio'</a>]]></note>
    </photo>
    It works very well.
    What I'd like to do now is place a linked graphic where the <groupTitle> is. I don't have it posted yet, but everything is working, except I only have text showing now, and no link (which I must have as a way to go back to my main site).
    Again, any help is appreciated, but please keep in mind that I'm not a programmer. I design mainly for print, not the web.
    Cheers,
    Alex

Maybe you are looking for

  • Bootcamp not installed

    OK, help. I installed Snow Leopard when it first came out and there is no Bootcamp on my iMac. I looked in the install disk and there is no option to install Bootcamp. I upgraded to Lion and still no Bootcamp. Where am I going wrong? What do I do to

  • Transportable tablespaces with Logical Standby

    Does anyone know whether or not transportable tablespaces can be used in a Logical Standby environment? I know they can be used with a Physical Standby, and the documentation covers how to do this, but there's nothing about Logical Standby. This is O

  • Error Prone Code.  Need Help.

    Last attempt to fix this code. I have included everything but the console code, which isn't needed here. THIS IS ALL THE CODE IS SUPPOSED TO DO: Using a console, an Employee enters their name, then enters the numbers of hours they worked, then enters

  • Creating an Action to turn off multiple layers

    I am using CS4 and I was wondering if it's possible to create an action to turn off multiple layers. We have to save a version of our files with only one layer showing, and to manually turn of the unwanted layers is getting to be a pain. Thanks for t

  • 9i or 10g?

    I'm new to Oracle and want to learn. A friend suggested starting with 9i to learn the product. Good idea? If so, I've downloaded it onto my Vista PC and get a "not compatible with this version of Windows" message when I start setup.exe. Any advice? T