XMLTYPE to XMLDOM conversion

I have a table with records that contain an field of type "xmltype"
I would like to read such a record and convert that (xmltype) field into an item with the structure of "xmldom.domdocument"
Can anyone help ?

You may stand a better chance at the XML DB forum: XML DB

Similar Messages

  • XMLDOM + XMLTYPE

    Hello.
    I need to generate XML document with special structure from Database 11g.
    I am using DBMS_XMLDOM to ganerate structure.
    <GenericData
    xmlns="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/message"
    xmlns:common="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/common"
    xmlns:compact="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/compact"
    xmlns:cross="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/cross"
    xmlns:generic="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/generic"
    xmlns:query="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/query"
    xmlns:structure="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/structure"
    xmlns:utility="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/utility"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/message SDMXMessage.xsd">
    <Dataset>
    <generic:Series>
    <generic:Series>
    <generic:Series>
    <generic:Series>
    </Dataset>
    </GenericData>
    One of the main nodes is Dataset.
    I am using select XMLELEMENT("Dataset", .........) INTO Q FROM EMS_001
    WHERE Q has XMLType.
    How i can add XMLType to XMLDOM document as node?

    Believe me, you should get rid of all this DOM stuff, you'll have more luck doing the whole thing with SQL/XML functions only.
    Not only you'll have a clearer, easier to debug code but also a lot more scalable when applied on large datasets.I Thought about it. But i have more than 2 data sources and can't get them all in 1 select.
    I find a best solution for myself:
    DECLARE
    DOC DBMS_XMLDOM.DOMDOCUMENT;
    TAGDOC DBMS_XMLDOM.DOMDOCUMENT;
    ROOT_ELEMENT DBMS_XMLDOM.DOMELEMENT;
    ELEM DBMS_XMLDOM.DOMELEMENT;
    ROOT_NODE DBMS_XMLDOM.DOMNODE;
    NODE DBMS_XMLDOM.DOMNODE;
    C CLOB;
    TAG XMLType;
    BEGIN
    DOC := DBMS_XMLDOM.CREATEDOCUMENT('http://www.w3.org/2001/XMLSchema', NULL, NULL);
    DBMS_XMLDOM.SETVERSION(DOC, '1.0');
    ROOT_ELEMENT := DBMS_XMLDOM.CREATEELEMENT(DOC, 'GenericData', 'xmlns');
    DBMS_XMLDOM.SETATTRIBUTE(ROOT_ELEMENT, 'xmlns', 'http://www.SDMX.org/resources/SDMXML/schemas/v1_0/message');
    DBMS_XMLDOM.SETATTRIBUTE(ROOT_ELEMENT, 'xmlns:generic', 'http://www.SDMX.org/resources/SDMXML/schemas/v1_0/generic');
    ROOT_NODE := DBMS_XMLDOM.MAKENODE(ROOT_ELEMENT);
    NODE := DBMS_XMLDOM.MAKENODE(DOC);
    NODE := DBMS_XMLDOM.APPENDCHILD(NODE, ROOT_NODE);
    ---------------------- HEADER TAG -------------------
    SELECT XMLELEMENT("Header", XMLATTRIBUTES('singHead' AS "Id"),
    XMLELEMENT("ID", -944960705),
    XMLELEMENT("Test", 'false'),
    XMLELEMENT("Truncated", 'false'),
    XMLELEMENT("Prepared", '2011-01-27T04:32:42'),
    XMLELEMENT("Extracted", '2011-01-27T04:32:42'),
    XMLELEMENT("Sender", XMLATTRIBUTES('FTS' AS "id"),
    XMLELEMENT("Name", XMLATTRIBUTES('en' AS "xml:lang"), 'FFFF'),
    XMLELEMENT("Name", XMLATTRIBUTES('ru' AS "xml:lang"), 'ФФФФ'),
    XMLELEMENT("Contact",
    XMLELEMENT("Name", XMLATTRIBUTES('ru' AS "xml:lang"), 'JOHN'),
    XMLELEMENT("URI", 'mailto:[email protected]'))),
    XMLELEMENT("Receiver", XMLATTRIBUTES('1' AS "id"),
    XMLELEMENT("Name", XMLATTRIBUTES('ru' AS "xml:lang"), 'ФФФФ'),
    XMLELEMENT("Contact",
    XMLELEMENT("Name", XMLATTRIBUTES('ru' AS "xml:lang"), 'JOHN'),
    XMLELEMENT("Telephone", '+000.000.0000'))),
    XMLELEMENT("DataSetAgency", 1),
    XMLELEMENT("DataSetID", 1812022)
    ) INTO TAG FROM DUAL;
    TAGDOC := DBMS_XMLDOM.NEWDOMDOCUMENT(TAG);
    ELEM := DBMS_XMLDOM.GETDOCUMENTELEMENT(TAGDOC);
    ELEM := DBMS_XMLDOM.MAKEELEMENT(DBMS_XMLDOM.IMPORTNODE(DOC,DBMS_XMLDOM.MAKENODE(ELEM),TRUE));
    ELEM := DBMS_XMLDOM.MAKEELEMENT(DBMS_XMLDOM.APPENDCHILD(DBMS_XMLDOM.MAKENODE(ROOT_ELEMENT),DBMS_XMLDOM.MAKENODE(ELEM)));
    ---------------------- HEADER TAG -------------------
    ---------------------- DATASET TAG ------------------
    TAG := XMLTYPE('<DataSet xmlns:generic="http://www.SDMX.org/resources/SDMXML/schemas/v1_0/generic">
         <generic:Series>
              <generic:SeriesKey>
                   <generic:Value concept="okato" value="643"/>
                   <generic:Value concept="uslug" value="1"/>
              </generic:SeriesKey>
              <generic:Attributes>
                   <generic:Value concept="EI" value="percent"/>
                   <generic:Value concept="PERIOD" value="year"/>
              </generic:Attributes>
              <generic:Obs>
                   <generic:Time>1995</generic:Time>
                   <generic:ObsValue value="108,6"/>
              </generic:Obs>
         </generic:Series>
    </DataSet>
    TAGDOC := DBMS_XMLDOM.NEWDOMDOCUMENT(TAG);
    ELEM := DBMS_XMLDOM.GETDOCUMENTELEMENT(TAGDOC);
    DBMS_XMLDOM.REMOVEATTRIBUTE(ELEM, 'xmlns:generic');
    ELEM := DBMS_XMLDOM.MAKEELEMENT(DBMS_XMLDOM.IMPORTNODE(DOC,DBMS_XMLDOM.MAKENODE(ELEM),TRUE));
    ELEM := DBMS_XMLDOM.MAKEELEMENT(DBMS_XMLDOM.APPENDCHILD(DBMS_XMLDOM.MAKENODE(ROOT_ELEMENT),DBMS_XMLDOM.MAKENODE(ELEM)));
    ---------------------- DATASET TAG ------------------
    DBMS_LOB.CREATETEMPORARY(C, TRUE, DBMS_LOB.SESSION);
    DBMS_XMLDOM.WRITETOCLOB(DOC, C);
    INSERT INTO PROBA VALUES (C);
    COMMIT;
    DBMS_XMLDOM.FREENODE(NODE);
    DBMS_XMLDOM.FREENODE(ROOT_NODE);
    DBMS_XMLDOM.FREEDOCUMENT(TAGDOC);
    DBMS_XMLDOM.FREEDOCUMENT(DOC);
    END;
    As you see i can get nodes data from SELECT and add them as nodes to main XML.
    Edited by: Alexys on 10.04.2012 12:04
    Edited by: Alexys on 10.04.2012 12:05
    Edited by: Alexys on 10.04.2012 12:06

  • UTL_DBWS, XML Document as a parameter

    I'm struggling with using a fully formed xml document as a parameter to a web service.
    Using this code I'm able to connect to the web service and sans the arg1 argument everything works.
    When I as in the code below use xmltype.toStringValue() or xmltype.toClobValue() charachters like < and > is replaced with the html encoded version (&lt; and &gt;) which does'nt work very well with the recieving web service.
    All three parameters is defined as string on the recieving web service.
    I've been searching this forum and using google, but can't find any examples doing something like this.
    Any help or pointers appreciated.
    procedure forwardToQueue is
    svc_ sys.utl_dbws.service;
    call_ sys.utl_dbws.call;
    svc_qname sys.utl_dbws.qname;
    response sys.xmltype;
    request sys.xmltype;
    utMelding sys.xmltype;
    t1 sys.xmltype;
    t2 sys.xmltype;
    doc xmldom.DomDocument;
    fListe xmldom.DOMNodeList;
    tmpL xmldom.DOMNodeList;
    fElement xmldom.domNode;
    tmp xmldom.domNode;
    meldingId strliten;
    arg0_node xmldom.domnode;
    arg0_elmt xmldom.domelement;
    arg0_text xmldom.domtext;
    arg1_node xmldom.domnode;
    arg1_elmt xmldom.domelement;
    arg1_text xmldom.domtext;
    arg2_node xmldom.domnode;
    arg2_elmt xmldom.domelement;
    arg2_text xmldom.domtext;
    child_doc xmldom.domdocument;
    main_node xmldom.domnode;
    root_node xmldom.domnode;
    root_elmt xmldom.domelement;
    x sys.xmltype;
    c varchar2(32000);
    bs_chr strmax;
    l_service sys.UTL_DBWS.service;
    l_call sys.UTL_DBWS.call;
    l_result ANYDATA;
    l_wsdl_url strmax := 'http://salah-test.sismo.local:8080/SIMSEJB/SIMSFacadeBean?wsdl';
    l_namespace strmax := 'http://salah-test.sismo.local:8080/SIMSEJB/SIMSFacadeBean';
    l_service_qname sys.utl_dbws.qname;
    begin
    procName := 'hentQueue';
    pl('*************** '||procName||' ***************');
    svc_qname := sys.utl_dbws.to_qname(null, 'SIMSFacadeBeanService');
    svc_ := sys.utl_dbws.create_service(svc_qname);
    call_ := sys.utl_dbws.create_call(svc_);
    sys.utl_dbws.set_target_endpoint_address(call_, 'http://salah-test.sismo.local:8080/SIMSEJB/SIMSFacadeBean');
    sys.utl_dbws.set_property(call_, 'SOAPACTION_USE', 'TRUE');
    sys.utl_dbws.set_property(call_, 'SOAPACTION_URI', 'sendMessage');
    sys.utl_dbws.set_property(call_, 'OPERATION_STYLE', 'document');
    x := genererSvar;
    doc := xmldom.newDOMDocument;
    main_node := xmldom.makeNode(doc);
    root_elmt := xmldom.createelement(doc, 'q0:sendMessage');
    xmldom.setattribute(root_elmt, 'xmlns:q0', 'si.sims.intern.service');
    root_node := xmldom.appendChild(main_node, xmldom.makeNode(root_elmt));
    -- Adding arg 0 as a string
    arg0_elmt := xmldom.createelement(doc, 'arg0');
    arg0_node := xmldom.appendchild(root_node, xmldom.makenode(arg0_elmt));
    arg0_text := xmldom.createtextnode(doc, '2');
    arg0_node := xmldom.appendchild(arg0_node, xmldom.makenode(arg0_text));
                   -- Adding arg 1 as a string
    arg1_elmt := xmldom.createelement(doc, 'arg1');
    arg1_node := xmldom.appendchild(root_node, xmldom.makenode(arg1_elmt));
    arg1_text := xmldom.createtextnode(doc, x.getClobVal());
    arg1_node := xmldom.appendchild(arg1_node, xmldom.makenode(arg1_text));
    -- Adding arg 2 as a string
    arg2_elmt := xmldom.createelement(doc, 'arg2');
    arg2_node := xmldom.appendchild(root_node, xmldom.makenode(arg2_elmt));
    arg2_text := xmldom.createtextnode(doc, 'false');
    arg2_node := xmldom.appendchild(arg2_node, xmldom.makenode(arg2_text));
    request := xmldom.getxmltype(doc);
    pl('Request:');
    pl(request.getStringVal());
    response := sys.utl_dbws.invoke(call_, request);
    pl('Showing respons');
    pl(response.getStringVal());
    doc := DBMS_XMLDOM.newDomDocument(response);
    sys.utl_dbws.release_call(call_);
    sys.utl_dbws.release_service(svc_);
    end forwardToQueue;

    Is the Document well defined via schema? You might be able to use the autotype
    ant task to generate a serializer.
    Otherwise, serialize the document to a string, then wrap it in <[CDATA[...]]>
    on the return. The calling app will need to understand that the string is xml,
    and then desrailize it manually.
    Mike
    "Surya" <[email protected]> wrote:
    >
    I have web service which has to retuen an XML document (org.w3c.dom.Document)
    as
    a paramter. Since this is not a supported data type for in-out paramaters,
    I will
    have to serialize and write my own converter. What is the best solution?
    Is there
    any class/library that can convert the document into String which I can
    return
    as a parameter and again get create a XML document in the client side.
    Thanks -Surya

  • Get the tags and hierarchy as output

    Hi gurus!
    What I need to do is to get as output what tags i have in my xml. Also i need to know the hierarchy of these tags.
    If my XML is this:
    <root>
         <person>
              <name>Mary</name>
              <role>Queen</role>
         </person>
         <person>
              <name>George</name>
              <role>King</role>
         </person>
    </root>I want my output to be something like:
    Tag     Parent
    root     null
    person     root
    name     person
    role     personThe important thing here is that i don't know what tags are in the XML file and therefore i have to to it this way.
    I don't have any previous knowledge of XML parsing in pl SQL but I´m assuming this is best done somehow with xmltypes. So far i have experimented with an xmltype instance but I'm stuck.
    Any help is greatly appreciated!!
    My version is 10.2.0.1.0

    Hey,
    We ended up redoing the whole thing with xmldom. Below are snippets of the final solution that got the processing time down from about one hour to 4 minutes for a 4Mb XML file.
    procedure getChild(node xmldom.DOMNode, Id_parent number) is
      v_id          number;
      v_id_parent   number := Id_parent;
      nl_children   xmlDom.DOMNodeList;
      n             xmlDom.DOMNode;
      v_value       varchar2(3000);
      v_Name        varchar2(3000);
      begin
       nl_children := xmldom.getChildNodes(node);
      for i in 0..xmldom.getLength(nl_children)-1 loop
          n := xmldom.item(nl_children, i);
          v_Name := xmldom.getNodeName(n);
          v_id := lueXml.ELEMENT_ID;
          if xmldom.getNodeType(n) = xmldom.TEXT_NODE then
            v_value := xmldom.getNodeValue(n);
            update a_xml_taulu t set t.value = v_value
               where t.id = lueXml.ELEMENT_ID;
               commit;
          else
            lueXml.ELEMENT_ID := lueXml.ELEMENT_ID + 1;
            insert into a_xml_taulu (id, tag, parent, value)
               values (lueXml.ELEMENT_ID, v_Name, v_id_parent, '');
               commit;
            getChild(n, lueXml.ELEMENT_ID);
          end if;
      end loop;
    end getChild;Which is called by
    procedure readXMLfile is
      directory varchar2(100)     := 'testdir';
      filename  varchar2(100)     := 'File.xml';
      v_file         bfile    := bfilename(directory,filename);
      v_nclob        nclob;
      v_dest_offset  number   := 1;
      v_src_offset   number   := 1;
      v_lang_context integer  := DBMS_LOB.DEFAULT_LANG_CTX;
      v_warning      number;
      v_xmltype      xmltype;
      doc            xmldom.DOMDocument;
      nl             xmldom.DOMNodeList;
      n              xmldom.DOMNode;
      v_root_tag     varchar2(200);
      begin
        DELETE FROM a_xml_taulu;
        DELETE FROM a_temp_xml_storage;
        DELETE FROM a_temp_clob;
        commit;
      begin
        dbms_output.put_line('Starting insert of a_temp_clob at time '||to_char(sysdate, 'HH:MM:SS'));
        INSERT INTO a_temp_clob(id, file_name, xml_file, timestamp)
             VALUES (1001, filename, empty_clob(), sysdate)
          RETURNING xml_file INTO v_nclob;
        DBMS_LOB.fileopen(v_file);
        dbms_output.put_line('loading clob at '|| to_char(sysdate, 'HH:MM:SS'));
        DBMS_LOB.loadclobfromfile(dest_lob     => v_nclob,
                                  src_bfile    =>  v_file,
                                  amount       =>  DBMS_LOB.LOBMAXSIZE,
                                  dest_offset  => v_dest_offset,
                                  src_offset   => v_src_offset,
                                  bfile_csid   => nls_charset_id('AL16UTF16LE'),
                                  lang_context => v_lang_context,
                                  warning      => v_warning);
        DBMS_LOB.close(v_file);            
        dbms_output.put_line('loaded clob at '||to_char(sysdate, 'HH:MM:SS'));
        INSERT INTO a_temp_clob(id, file_name, xml_file, timestamp)
            VALUES(1001, filename, v_nclob, sysdate);
        if v_warning > 0 then
            Dbms_Output.Put_Line ('Warning');
        end if;
      end;
      begin 
        dbms_output.put_line('Starting insert at time '||to_char(sysdate, 'HH:MM:SS'));
        INSERT INTO a_temp_xml_storage VALUES(xmltype(to_clob(v_nclob)));
        commit;
        dbms_output.put_line('Ending insert at time '||to_char(sysdate, 'HH:MM:SS'));
        select t.sys_nc_rowinfo$ into v_xmltype from a_temp_xml_storage t;
        luexml.ELEMENT_ID := 0;                                   -- this is a global variable
        doc := DBMS_XMLDOM.newDOMDocument(v_xmltype);
        nl := xmldom.getElementsByTagName(doc, '*');
        n := xmldom.item(nl, 0);
        v_root_tag := xmldom.getNodeName(n);
         insert into a_xml_taulu (id, tag, parent, value)
               values (lueXml.ELEMENT_ID, v_root_tag, null, '');
        lueXml.getChild(n, luexml.ELEMENT_ID);
        dbms_output.put_line('getChild iterations done at '||to_char(sysdate, 'HH:MM:SS'));
    end; 
    end readXMLfile;Im sure this version could be further optimized but it is fast enough already...
    Thank you all for you help in this matter!

  • Input xml  to where clause ..

    An input XML passed as a parameter to the oracle stored procedure . based on input xml the dynamic predicate( where ) clause need to be build . for example
    <map opt="and" >
    <map opt="and" >
    <condition opt="equal" >
         <key>job_id</key>
         <value>IT_PROG</value>
    </condition>
    <conditon opt="equal" >
              <key>salary</key>
              <value>9000</value>
    </conditon>
    </map>
    <map opt="or" >
    <condition opt="equal" >
              <key>manger_id</key>
              <value>100</value>
    </condition>
    <conditon opt="like" >
                   <key>lastname</key>
                   <value>m</value>
    </conditon>
    </map>
    </map>
    select * from employees where (job_id='IT_PROG' and salary='9000') or (manager_id = '100' or last_name like '%m%').
    please help with pl/sql part of this . i have written a pl/sql which can print the element tag , what changes should i make this code .
    The input xml will be dynamic based on the input xml the predicate should be prepared, i want to use oracle dom .
    declare
    vxml xmltype;
    l_xmldoc xmldom.DOMDocument;
    l_ndlist xmldom.DOMNodeList;
    l_node xmldom.DOMNode;
    l_element xmldom.DOMElement;
    len number;
    BEGIN
    vxml:= xmltype('<map opt="and" >
    <map opt="and" >
    <condition opt="equal" >
         <key>job_id</key>
         <value>IT_PROG</value>
    </condition>
    <conditon opt="equal" >
              <key>salary</key>
              <value>9000</value>
    </conditon>
    </map>
    <map opt="or" >
    <condition opt="equal" >
              <key>manger_id</key>
              <value>100</value>
    </condition>
    <conditon opt="like" >
                   <key>lastname</key>
                   <value>m</value>
    </conditon>
    </map>
    </map>
    l_xmldoc := xmldom.newDOMDocument(vxml);
    l_ndlist := xmldom.getElementsByTagName(l_xmldoc, '*');
    len := xmldom.getLength(l_ndlist);
    -- loop through elements
    for i in 1..len-1 loop
    l_node := xmldom.item(l_ndlist, i);
    dbms_output.put( xmldom.getNodeName(l_node));
    l_node := xmldom.getFirstChild(l_node);
    if xmldom.getNodeType(l_node) = xmldom.TEXT_NODE then
    dbms_output.put('='|| xmldom.getNodeValue(l_node) || ' ');
    end if;
    dbms_output.put(' ');
    end loop;
    dbms_output.put_line('');
    END;

    >
    our application has java front end , the users have option to select multiple filter values . the frond end developers will send an xml construct as the one i have showed . based on the input xml i have to apply those filters on a table . so i thought using xml dom and parse the xml and make a dynamic sql from that .
    >
    why java app needs to send XML? Let it create SQL and execute it.
    Of course you can do it in PL/SQL but it less convenient comparing to Java.
    If you can extract values from XML, then just create SQL for them, assign bind vars and execute it dynamically.
    Yes, you will have to implement lots of IF logic.
    Advise: Use bind variables as placeholders for values to avoid injection attacks. Do not concatenate values into your dynamic SQL.

  • Generate XML from Oracle Table Data

    Hi All,
    I am new to this network. I am also new to oracle XML package. I want a help for the below query.
    CREATE TABLE EMP(ID NUMBER PRIMARY KEY, NAME VARCHAR2(10), PHONE NUMBER);
    INSERT INTO EMP(ID,NAME,PHONE) VALUES (11,'Joy',1234);
    INSERT INTO EMP(ID,NAME,PHONE) VALUES (22,'Mike',5678);
    INSERT INTO EMP(ID,NAME,PHONE) VALUES (33,'Jason',NULL);
    COMMIT;
    I want to export the EMP table data in a XML file with the below format.
    Required Output:
    <?xml version="1.0" encoding="UTF-8"?><STATICDATA><EMP><ID>11</ID><NAME>Joy</NAME></EMP></STATICDATA>
    <?xml version="1.0" encoding="UTF-8"?><STATICDATA><EMP><ID>22</ID><NAME>Mike</NAME></EMP></STATICDATA>
    <?xml version="1.0" encoding="UTF-8"?><STATICDATA><EMP><ID>33</ID><NAME>Jason</NAME></EMP></STATICDATA>
    I have used some XML functions and have written the below query.
    select XMLROOT(XMLELEMENT(staticdata,XMLELEMENT(EMP,XMLELEMENT(ID,ID),XMLELEMENT(NAME,NAME))), version '1.0" encoding="UTF-8') xml FROM EMP;
    output of my query:
    <?xml version="1.0" encoding="UTF-8"?>
    <STATICDATA>
    <EMP>
    <ID>11</ID>
    <NAME>Joy</NAME>
    </EMP>
    </STATICDATA>
    <?xml version="1.0" encoding="UTF-8"?>
    <STATICDATA>
    <EMP>
    <ID>22</ID>
    <NAME>Mike</NAME>
    </EMP>
    </STATICDATA>
    <?xml version="1.0" encoding="UTF-8"?>
    <STATICDATA>
    <EMP>
    <ID>33</ID>
    <NAME>Jason</NAME>
    </EMP>
    </STATICDATA>
    But i want the out as the required output above. every record in a single line. can any one help me in achieving the required output. also can i export all the columns of the table by some thing like select * from the table in XML file ?
    Thanks,
    Sartaj

    user13683418 wrote:
    Hi All,
    I am new to this network. I am also new to oracle XML package. I want a help for the below query.
    CREATE TABLE EMP(ID NUMBER PRIMARY KEY, NAME VARCHAR2(10), PHONE NUMBER);
    INSERT INTO EMP(ID,NAME,PHONE) VALUES (11,'Joy',1234);
    INSERT INTO EMP(ID,NAME,PHONE) VALUES (22,'Mike',5678);
    INSERT INTO EMP(ID,NAME,PHONE) VALUES (33,'Jason',NULL);
    COMMIT;
    I want to export the EMP table data in a XML file with the below format.
    Required Output:
    <?xml version="1.0" encoding="UTF-8"?><STATICDATA><EMP><ID>11</ID><NAME>Joy</NAME></EMP></STATICDATA>
    <?xml version="1.0" encoding="UTF-8"?><STATICDATA><EMP><ID>22</ID><NAME>Mike</NAME></EMP></STATICDATA>
    <?xml version="1.0" encoding="UTF-8"?><STATICDATA><EMP><ID>33</ID><NAME>Jason</NAME></EMP></STATICDATA>
    I have used some XML functions and have written the below query.
    select XMLROOT(XMLELEMENT(staticdata,XMLELEMENT(EMP,XMLELEMENT(ID,ID),XMLELEMENT(NAME,NAME))), version '1.0" encoding="UTF-8') xml FROM EMP;
    output of my query:
    <?xml version="1.0" encoding="UTF-8"?>
    <STATICDATA>
    <EMP>
    <ID>11</ID>
    <NAME>Joy</NAME>
    </EMP>
    </STATICDATA>
    <?xml version="1.0" encoding="UTF-8"?>
    <STATICDATA>
    <EMP>
    <ID>22</ID>
    <NAME>Mike</NAME>
    </EMP>
    </STATICDATA>
    <?xml version="1.0" encoding="UTF-8"?>
    <STATICDATA>
    <EMP>
    <ID>33</ID>
    <NAME>Jason</NAME>
    </EMP>
    </STATICDATA>
    But i want the out as the required output above. every record in a single line.Why?
    Some things output XML all as one stream, some things naturally display it structured. It doesn't matter as the XML is still the same because by it's very nature it is a structured data definition. Anything that reads XML will be able to read it whether it's on one line (streamed) or structured.
    also can i export all the columns of the table by some thing like select * from the table in XML file ?A couple of ways of exporting XML to a file...
    -- DBMS_XSLPROCESSOR.clob2file
    -- outputs a clob to a file
    DECLARE
       ctx   DBMS_XMLGEN.ctxtype;
    BEGIN
       ctx := DBMS_XMLGEN.newcontext ('select * from emp');
       DBMS_XSLPROCESSOR.clob2file (DBMS_XMLGEN.getxml (ctx), 'TEMP', 'emp.xml');
       DBMS_XMLGEN.closecontext (ctx);
    END;
    PL/SQL procedure successfully completed.or
    ..snip..
      v_xml                 XMLTYPE;
      v_doc                 XMLDOM.DOMDocument;
      v_dir                 VARCHAR2(2000);
      v_file                VARCHAR2(2000);
    BEGIN
      v_xml := ... populate with XML ...;
      v_dir := 'TEST_DIR'; -- directory object name (in UPPER CASE)
      v_file := 'myfile.xml';
      v_doc := DBMS_XMLDOM.NEWDOMDOCUMENT(v_xml);
      DBMS_XMLDOM.WRITETOFILE(v_doc, v_dir||'\'||v_file, 'UTF-8');
      DBMS_XMLDOM.FREEDOCUMENT(v_doc);
    ..snip..

  • Conversion of a Base64EncodedXML CLOB to XMLTYPE

    I have an xml file which is base64 encoded and the base64 encoded file is stored as a clob. I want to do all the manipulation in PL/SQL and modify the clob column with one of xmltype
    Heres the steps I've got so far:
    i) convert the clob to a blob using dbms_lob.converttoclob
    ii) Since this is now in binary format I'm asusming that I don't need to cast to raw
    iii) decode the binary file using UTL_ENCODE.base64_decode
    iv) add an additional column  temp_xml as type xml_type
    v) update the temp_xml column with the values of the original column.
    update <tablename>
                   set temp_xml = xmltype(orig_clob_column) vi) At this stage I will see if I can read the xml in the new column and if all is successful, I will drop the orig_clob_column and rename temp_xml to orig_clob_column.
    If I've missed anything or anyone's got some gotchas for me, it would be appreciated.
    Message was edited by:
    Keith Jamieson
    Message was edited by:
    Keith Jamieson

    I am using Oracle 11g Windows and based on the example here:
    http://www.peakretrieval.com/plsql/Chapter16/Convert.sql
    create or replace PROCEDURE CONVERT_ME (
       v_blob_or_clob IN NUMBER,
       v_blob IN OUT BLOB,
       v_clob IN OUT CLOB,
       v_amount IN OUT NUMBER,
       v_blob_offset IN OUT NUMBER,
       v_clob_offset IN OUT NUMBER,
       v_lang_context IN OUT NUMBER,
       v_warning OUT NUMBER)
    AS
    BEGIN
       DBMS_LOB.OPEN(v_blob, DBMS_LOB.LOB_READWRITE);
       DBMS_LOB.OPEN(v_clob, DBMS_LOB.LOB_READWRITE);
       IF v_blob_or_clob = 0
       THEN
       DBMS_LOB.CONVERTTOBLOB(v_blob,
                              v_clob,
                              v_amount,
                              v_blob_offset,
                              v_clob_offset,
                              1,
                              v_lang_context,
                              v_warning);
       ELSE
       DBMS_LOB.CONVERTTOCLOB(v_clob,
                              v_blob,
                              v_amount,
                              v_clob_offset,
                              v_blob_offset,
                              1,
                              v_lang_context,
                              v_warning);
       END IF;
       DBMS_LOB.CLOSE(v_blob);
       DBMS_LOB.CLOSE(v_clob);
    END;When I run this sample code
    DECLARE
       v_clob_or_blob NUMBER;
       v_blob_locator BLOB;
       v_clob_locator CLOB;
       v_blob_offset NUMBER;
       v_clob_offset NUMBER;
       v_lang_context NUMBER := DBMS_LOB.DEFAULT_LANG_CTX;
       v_warning NUMBER;
       v_string_length NUMBER(10);
       v_source_locator BLOB;
       v_destination_locator BLOB;
       v_amount PLS_INTEGER;
       v_string CLOB;
    BEGIN
       -- CONVERT CLOB TO BLOB
       SELECT description
       INTO v_clob_locator
       FROM book_samples
       WHERE book_sample_id = 1
       FOR UPDATE;
       SELECT misc
       INTO v_blob_locator
       FROM book_samples
       WHERE book_sample_id = 1
       FOR UPDATE;
       v_string_length := DBMS_LOB.GETLENGTH(v_blob_locator);
       v_amount := DBMS_LOB.GETLENGTH(v_clob_locator);
       DBMS_OUTPUT.PUT_LINE('The initial length of the BLOB is: '||v_string_length);
            v_clob_or_blob := 0; -- Convert clob to blob
            v_clob_offset := 1;
            v_blob_offset := 1;
            CONVERT_ME(v_clob_or_blob,
                    v_blob_locator,
                    v_clob_locator,
                    v_amount,
                    v_blob_offset,
                    v_clob_offset,
                    v_lang_context,
                    v_warning);
       v_string_length := DBMS_LOB.GETLENGTH(v_blob_locator);
       DBMS_OUTPUT.PUT_LINE('The length of the BLOB post-conversion is: '||v_string_length);
       -- COPY BLOB FOR ONE ROW TO BLOB IN ANOTHER
       v_source_locator := v_blob_locator;
       SELECT misc
       INTO v_destination_locator
       FROM book_samples
       WHERE book_sample_id = 2
       FOR UPDATE;
       DBMS_LOB.COPY(v_destination_locator, v_source_locator, 32768, 1, 1);
       v_string_length := DBMS_LOB.GETLENGTH(v_destination_locator);
       DBMS_OUTPUT.PUT_LINE('The length of the BLOB post-copy is: '||v_string_length);
       -- COPY BLOB FOR RECORD 2 BACK TO A CLOB
       SELECT description
       INTO v_clob_locator
       FROM book_samples
       WHERE book_sample_id = 2
       FOR UPDATE;
       SELECT misc
       INTO v_blob_locator
       FROM book_samples
       WHERE book_sample_id = 2
       FOR UPDATE;
       v_string_length := DBMS_LOB.GETLENGTH(v_clob_locator);
       v_amount := DBMS_LOB.GETLENGTH(v_blob_locator);
       DBMS_OUTPUT.PUT_LINE('The initial length of the CLOB (record 2) is: '||v_string_length);
            v_clob_or_blob := 1; -- Convert blob to clob
            v_clob_offset := 1;
            v_blob_offset := 1;
            CONVERT_ME(v_clob_or_blob,
                    v_blob_locator,
                    v_clob_locator,
                    v_amount,
                    v_clob_offset,
                    v_blob_offset,
                    v_lang_context,
                    v_warning);
       v_string_length := DBMS_LOB.GETLENGTH(v_clob_locator);
       SELECT description
       INTO v_string
       FROM book_samples
       WHERE book_sample_id = 2;
       DBMS_OUTPUT.PUT_LINE('The length of the CLOB post-conversion is: '||v_string_length);
       DBMS_OUTPUT.PUT_LINE('     ');
       DBMS_OUTPUT.PUT_LINE('The converted CLOB');
       DBMS_OUTPUT.PUT_LINE('==================');
       DBMS_OUTPUT.PUT_LINE(SUBSTR(v_string,1,150));
       DBMS_OUTPUT.PUT_LINE(SUBSTR(v_string,151,300));
    EXCEPTION
       WHEN OTHERS
       THEN
          DBMS_OUTPUT.PUT_LINE('I''M BROKEN ... FIX ME!');
          DBMS_OUTPUT.PUT_LINE(SQLERRM);
    END;I get the following error:
    Length of blob before conversion
    The conver_me procedure is broken ...
    ORA-06502: PL/SQL: numeric or value error: invalid LOB locator specified: ORA-22275
    Length of blob after conversion

  • Is it possible to add variable defined as xmltype to an xmldom node?

    Hi,
    I'm trying to produce a complex XML document that doesn't lend itself well to using SQL XML functions (xmlagg, xmlelement, etc.) because various disparate data needs to be pulled together via seperate queries and then stuck into the final document in the correct spots.
    So I've resorted to using the convoluted pl/sql xmldom functions. What I'm wondering though is if it is possible to take data in an xmltype variable and somehow append it as a node within my xml document? Something as in the following pseudo code:
    begin
    doc := xmldom.newDOMDocument;
    main_node := xmldom.makeNode (doc);
    select xmlelement("Address",...) -- more xmlelements containing related address info (street, city, etc.)
    into l_address
    from ...;
    new_node := xmldom.appendChild (main_node, xmldom.makeNode (l_address));
    end;
    If possible, this would save me a tremendous amount of time from having to code every element and attributes via the xmldom functions.
    Thanks,
    Alan

    I've done the same scenario you are describing, shove XML defined in an XMLType into a DOMDocument. I munged the code to hide system specific references so the code works, just not as pasted here. The document is being built in o_response_doc and goes after the node previously built in l_rsp_msg_nd. The input is l_xmltype. May be a better way but I never found one and came up with this based on the Oracle documentation and trial and error.
        -- Convert the XMLType to a DOMDocument so we can extract the needed node
        --  and insert it into the response DOMDocument
        l_temp_domdoc := dbms_xmldom.newdomdocument(l_xmltype);
        l_inq_nodelist := dbms_xmldom.getelementsbytagname(l_temp_domdoc,
                                                           'DesiredXMLTypeNodeName');
        l_inq_nl_len := xmldom.getlength(l_inq_nodelist);
        IF l_inq_nl_len > 0 THEN
           -- Take the node above and adopt it into the response document
           l_temp2_nd := dbms_xmldom.importNode(o_response_doc,
                                                dbms_xmldom.item(l_inq_nodelist, 0),
                                                TRUE);
           -- Remove the a: namespace that was autoadded.  (this was defined in the l_xmltype XML)
           dbms_xmldom.removeattribute(dbms_xmldom.makeelement(l_temp2_nd),
                                       <ns_pfx>,
                                       <ns_uri>);
           -- Put the node in the correct position in the response document                                          
           l_temp2_nd := xdb.dbms_xmldom.appendChild(l_rsp_msg_nd, l_temp2_nd);
        END IF;
        dbms_xmldom.freeDocument(l_temp_domdoc);

  • XMLType and Special Character Conversion

    I'm looking for something to convert special characters like &amp to the actual & it represents.
    I can't seem to find a method using
    extract for an xmltype or xslprocessor.valueOf
    I'm sure its something simple, but I'm having trouble putting my finger on it. Can anyone point me in the right direction?
    Thanks

    Let me restate. When I use and XMLDom and the xslprocessor.valueOf function, "&amp" is converted to "&"
    when I use v_char2 := v_doc.extract('/LoanPkg/Property/PRPTY_STRT_NME/text()').GetStringval;
    It doesn't convert it.

  • Conversion/Type Cast of sys.XMLType to NUMBER and VARCHAR2

    How do we typecast or convert a variable of the type sys.XMLType to NUMBER and VARCHAR2?
    For e.g. I have a variable :-
    v_STATE sys.XMLType
    I want to convert it to either of the type NUMBER or VARCHAR2.

    How do we typecast or convert a variable of the type sys.XMLType to NUMBER and VARCHAR2?
    Your question is too vague to give a relevant answer.
    Typecasting doesn't make sense in this situation, XMLType is an opaque datatype, it's not like converting VARCHAR2 to NUMBER (or vice versa).
    Do you mean serializing the XML document, or extracting atomic node values, or something else ?
    Depending on your requirement, you may want to look for XMLSerialize() or XMLCast() functions.
    And on a side note, don't always expect people to search for your previous threads to find some useful information, such as a db version...

  • ORA-01460: unimplemented or unreasonable conversion requested

    Hi,
    i have a problem with a insert statement
    we use C# .net
    our database server version is
    Oracle Database 10g Client
    The problem is:
    When iam trying to insert records more than 248 it returns the "ORA-01460: unimplemented or unreasonable conversion requested" error. If the number of records are less than 248, then iam able to insert it successfully. Can u please suggest me what to do inorder to overcome with this.
    iam using the following query to insert.
    PROCEDURE PINSUPD_UNIT
    pi_unit_info CLOB,
    pi_user_id DPS_USER.USR_ID%TYPE,
    po_unit_cur OUT unit_cur
    ) AS
    v_xmlDoc      SYS.XMLTYPE;
    v_xmlNode      SYS.XMLTYPE;
    v_intXMLNodeCount      NUMBER;
    v_UNIT_ID ECON_UNIT.UNIT_ID%TYPE;
    v_DESCRIPTION ECON_UNIT.DESCRIPTION% TYPE;
    v_NAME ECON_UNIT.NAME%TYPE;
    v_UNIT ECON_UNIT.UNIT%TYPE;
    v_sysdate DATE;
    INVALID_XML EXCEPTION;
    BEGIN
    v_sysdate := TO_DATE( TO_CHAR(SYSDATE, 'DD/MM/YYYY HH:MI:SS AM'), 'DD/MM/YYYY HH:MI:SS AM');
    -- To extract the Data from the XML Input
    IF pi_unit_info IS NOT NULL AND pi_unit_info <> ' ' THEN
    v_intXMLNodeCount := 1;
    v_xmlDoc := SYS.XMLTYPE.CREATEXML(pi_unit_info);
    WHILE SYS.XMLTYPE.ExistsNode(v_xmlDoc, '//Unit_Details[' || v_intXMLNodeCount || ']') = 1
    LOOP
    v_xmlNode := SYS.XMLTYPE.EXTRACT(v_xmlDoc, '//Unit_Details[' || v_intXMLNodeCount || ']');
    v_UNIT_ID := 0;
    v_UNIT_ID := TO_NUMBER(SYS.XMLTYPE.EXTRACT(v_xmlNode, '//Unit_ID/text()').getStringVal(),'99999999999999999999999999999999999999');
    v_DESCRIPTION := '';
    v_DESCRIPTION := SYS.XMLTYPE.EXTRACT(v_xmlNode, '//Description/text()').getStringVal();
    v_NAME := '';
    v_NAME := SYS.XMLTYPE.EXTRACT(v_xmlNode, '//Name/text()').getStringVal();
    v_UNIT := '';
    v_UNIT := SYS.XMLTYPE.EXTRACT(v_xmlNode, '//Unit/text()').getStringVal();
    IF v_UNIT_ID = 0 THEN
    --To insert the Unit Details
    INSERT INTO
    ECON_UNIT
    UNIT_ID,
    NAME,
    UNIT,
    DESCRIPTION,
    USR_ID,
    LAST_UPDATED_DATE
    VALUES
    SEQ_UNIT.NEXTVAL,
    v_NAME,
    v_UNIT,
    v_DESCRIPTION,
    pi_user_id,
    v_sysdate
    DBMS_OUTPUT.put_line(v_name);
    ELSE
    --To update the Unit details
    UPDATE
    ECON_UNIT
    SET
    NAME = v_NAME,
    UNIT = v_UNIT,
    DESCRIPTION = v_DESCRIPTION,
    USR_ID = pi_user_id,
    LAST_UPDATED_DATE = v_sysdate
    WHERE
    UNIT_ID = v_UNIT_ID;
    DBMS_OUTPUT.put_line(v_name);
    END IF;
    v_intXMLNodeCount := v_intXMLNodeCount + 1;
    END LOOP;
    OPEN po_unit_cur FOR SELECT * FROM ECON_UNIT;
    ELSE
    RAISE INVALID_XML;
    END IF;
    i know it is a known problem, but still iam trying a lot to overcome it.

    I believe, PL/SQL has a limitation of 32K characters for a LONG parameter.

  • Calling a stored procedure with an XmlType parameter.

    I am attempting to execute a stored function via a named query. The stored procedure has a single parameter of Oracles 'xmltype', and also returns an xmltype. For example this dummy function
    function testXML(xml_in xmltype) return xmltype is
    begin
    return xml_in;
    end;
    Is it possible to make the named query call with an oracle.xdb.XMLType or oracle.xdb.dom.XDBDocument? I cannot find any examples of this being done. I also want the returning xmltype to be converted into a Java class.
    Another question - will I need to work with a conversion manager to achieve this?

    Local Exception Stack:
    Exception [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: Invalid column typeError Code: 17004
    Call:BEGIN ? := TestPackage.testXML(XML_IN=>?); END;
         bind => [=> RESULT, oracle.xml.parser.v2.XMLDocument@1a64732 => XML_IN]
    Query:DataReadQuery()
         at oracle.toplink.exceptions.DatabaseException.sqlException(DatabaseException.java:290)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:570)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:442)
         at oracle.toplink.threetier.ServerSession.executeCall(ServerSession.java:453)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:117)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:103)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:174)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeSelect(DatasourceCallQueryMechanism.java:156)
         at oracle.toplink.queryframework.DataReadQuery.executeNonCursor(DataReadQuery.java:118)
         at oracle.toplink.queryframework.DataReadQuery.executeDatabaseQuery(DataReadQuery.java:110)
         at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:603)

  • XML data from BLOB to CLOB - character set conversion

    Hi All,
    I'm trying to solve a problem with a character set conversion in PL/SQL in the following scenario:
    1. source is an XML as a BLOB variable.
    2. target is an XML as a CLOB variable.
    3. the problem I have is the following:
    - database character set is set to UTF-8
    - XML character set could be anything (UTF-8, ISO 8859-1, ISO 8859-2, ASCII, ...)
    - I need to write a procedure which converts the source BLOB content into the target CLOB taking into account the XML encoding and converts it into the DB default character set (UTF8).
    I've been able to implement a simple conversion function. However, this function expects static XML encoding ISO-8859-1. The main part of the function looks as follows:
    buffer := UTL_RAW.cast_to_varchar2(
    UTL_RAW.convert(
    DBMS_LOB.SUBSTR(source_blob_variable, 16000, pos)
    , 'American_America.UTF8'
    , 'American_America.we8iso8859p1')
    Does anyone have an idea how to rewrite the code to handle "any" XML encoding in the source BLOB file? In other words, is there a function in Oracle which converts XML character set names into Oracle character set values (ISO-8859-1 to we8iso8859p1, UTF-8 to UTF8, ...)?
    Thanks a lot for any help.
    Julius

    I want to pass a BLOB to some "createXML" procedure and get a proper XMLType in UTF8 character set, properly converted from whatever character set is the input in.As per documentation the generated XML has always the encoding set at the client side depending on NLS_LANG (default UTF-8), regardless of the input encoding, so I don't see a need to parse the PI of the XML:
    C:\>echo %NLS_LANG%
    %NLS_LANG%
    C:\>sqlplus
    SQL*Plus: Release 11.1.0.6.0 - Production on Wed Apr 30 08:54:12 2008
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> var cur refcursor
    SQL>
    SQL> declare
      2     b   blob := utl_raw.cast_to_raw ('<a>myxml</a>');
      3  begin
      4     open :cur for select xmlroot (xmltype (utl_raw.cast_to_varchar2 (b))) xml from dual;
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> print cur
    XML
    <?xml version="1.0" encoding="UTF-8"?><a>myxml</a>
    SQL> exit
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    C:\>set NLS_LANG=GERMAN_GERMANY.WE8ISO8859P1
    C:\>sqlplus
    SQL*Plus: Release 11.1.0.6.0 - Production on Mi Apr 30 08:55:02 2008
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    SQL> var cur refcursor
    SQL>
    SQL> declare
      2     b   blob := utl_raw.cast_to_raw ('<a>myxml</a>');
      3  begin
      4     open :cur for select xmlroot (xmltype (utl_raw.cast_to_varchar2 (b))) xml from dual;
      5  end;
      6  /
    PL/SQL-Prozedur erfolgreich abgeschlossen.
    SQL>
    SQL> print cur
    XML
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <a>myxml</a>

  • Trying to get UTF-8 data in and out of an oracle.xdb.XMLType

    I need to be able to put unicode text into an oracle.xdb.XMLType and
    then get it back out. I'm so close but it's still not quite working.
    Here's what I'm doing...
    // create a string with one unicode character (horizontalelipsis)
    String xmlString = new String(
    "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
    "<utf8>\n" +
    " <he val=\"8230\">\u2026</he>\n" +
    "</utf8>\n");
    // this is an oci8 connection
    Connection conn = getconnection();
    // this works with no exceptions
    XMLType xmlType = XMLType.createXML(conn, xmlString);
    // this is the problem here - BLOB b does not contain all the bytes
    // from xmlType. It seems to be short 2 bytes.
    BLOB b = xmlType.getBlobVal(871);
    String xmlTypeString = new String(b.getBytes(1L, (int) b.length()), "UTF-8");
    PrintStream out = new PrintStream(System.out, true, "UTF-8");
    out.print(xmlTypeString);
    out.close();
    What I get from this is this...
    <?xml version="1.0" encoding="UTF-8"?>
    <utf8>
    <he val="8230">[utf-8 bytes]</he>
    </utf8
    In the above, [utf-8 bytes] represents the correctly encoded UTF-8 bytes that
    were returned. But the output is missing the final closing bracket and the
    newline at the end. It seems that no matter what second argument I give b.getBytes(),
    it always returns the above. Even
    It seems that this code...
    BLOB b = xmlType.getBlobVal(871);
    always returns a BLOB that contains a few bytes short of what it should contain.
    What am I doint wrong? I'm sure I'm missing something here.
    Thanks much for your help.
    Here's info about the environment I'm working in.
    ============================ SYSTEM INFORMATION ============================
    SQL*Plus: Release 11.1.0.7.0 - Production on Fri May 15 11:54:34 2009
    select * from nls_database_parameters
    where parameter='NLS_CHARACTERSET'
    returns...
    WE8ISO8859P1
    select * from nls_database_parameters
    where parameter='NLS_NCHAR_CHARACTERSET'
    returns...
    AL16UTF16
    The operating system I'm working with is...
    SunOS hostname 5.10 Generic_120011-14 sun4u sparc SUNW,Netra-T12

    WE8ISO8859P1 does not support the ellipsis character. It is a WE8MSWIN1252 character. I wonder if your problem may have something to do with internal conversion to/from XML character reference (&#x2026). Unfortunately, I have no time to test. Please, try to use a simple loop and System.out.print to print all bytes of the return value of b.getBytes(1L, (int) b.length()). Also, check the value of b.length().
    -- Sergiusz

  • Inserting a long XML document into XMLType

    I'm trying to load the following document into an XMLType column in 10.2. I've tried every example I can find and can push the data into CLOBs using the Java work around just fine (http://www.oracle.com/technology/sample_code/tech/java/codesnippet/xmldb/HowToLoadLargeXML.html).
    Can anyone provide a solution or let me know if there is a limitation please?
    Given the table;
    SQL> describe xmltable_1
    Name Null? Type
    DOC_ID NUMBER
    XML_DATA XMLTYPE
    How do I load this data into 'XML_DATA'?
    <?xml version="1.0" encoding="UTF-8"?>
    <metadata>
    <idinfo>
    <citation>
    <citeinfo>
    <origin>Rand McNally and ESRI</origin>
    <pubdate>1996</pubdate>
    <title>ESRI Cities Geodata Set</title>
    <geoform>vector digital data</geoform>
    <onlink>\\OIS23\C$\Files\Working\Metadata\world\cities.shp</onlink>
    </citeinfo>
    </citation>
    <descript>
    <abstract>World Cities contains locations of major cities around the world. The cities include national capitals for each of the countries in World Countries 1998 as well as major population centers and landmark cities. World Cities was derived from ESRI's ArcWorld database and supplemented with other data from the Rand McNally New International Atlas</abstract>
    <purpose>606 points, 4 descriptive fields. Describes major world cities.</purpose>
    </descript>
    <timeperd>
    <timeinfo>
    <sngdate>
    <caldate>1996</caldate>
    </sngdate>
    </timeinfo>
    <current>publication date</current>
    </timeperd>
    <status>
    <progress>Complete</progress>
    <update>None planned</update>
    </status>
    <spdom>
    <bounding>
    <westbc>
    -165.270004</westbc>
    <eastbc>
    177.130188</eastbc>
    <northbc>
    78.199997</northbc>
    <southbc>
    -53.150002</southbc>
    </bounding>
    </spdom>
    <keywords>
    <theme>
    <themekt>city</themekt>
    <themekey>cities</themekey>
    </theme>
    </keywords>
    <accconst>none</accconst>
    <useconst>none</useconst>
    <ptcontac>
    <cntinfo>
    <cntperp>
    <cntper>unknown</cntper>
    <cntorg>unknown</cntorg>
    </cntperp>
    <cntpos>unknown</cntpos>
    <cntvoice>555-1212</cntvoice>
    </cntinfo>
    </ptcontac>
    <datacred>ESRI</datacred>
    <native>Microsoft Windows NT Version 4.0 (Build 1381) Service Pack 6; ESRI ArcCatalog 8.1.0.570</native>
    </idinfo>
    <dataqual>
    <attracc>
    <attraccr>no report available</attraccr>
    <qattracc>
    <attraccv>1000000</attraccv>
    <attracce>no report available</attracce>
    </qattracc>
    </attracc>
    <logic>no report available</logic>
    <complete>no report available</complete>
    <posacc>
    <horizpa>
    <horizpar>no report available</horizpar>
    </horizpa>
    <vertacc>
    <vertaccr>no report available</vertaccr>
    </vertacc>
    </posacc>
    <lineage>
    <srcinfo>
    <srccite>
    <citeinfo>
    <title>ESRI</title>
    </citeinfo>
    </srccite>
    <srcscale>20000000</srcscale>
    <typesrc>CD-ROM</typesrc>
    <srctime>
    <timeinfo>
    <sngdate>
    <caldate>1996</caldate>
    </sngdate>
    </timeinfo>
    <srccurr>publication date</srccurr>
    </srctime>
    <srccontr>no report available</srccontr>
    </srcinfo>
    <procstep>
    <procdesc>no report available</procdesc>
    <procdate>Unknown</procdate>
    </procstep>
    </lineage>
    </dataqual>
    <spdoinfo>
    <direct>Vector</direct>
    <ptvctinf>
    <sdtsterm>
    <sdtstype>Entity point</sdtstype>
    <ptvctcnt>606</ptvctcnt>
    </sdtsterm>
    </ptvctinf>
    </spdoinfo>
    <spref>
    <horizsys>
    <geograph>
    <latres>0.000001</latres>
    <longres>0.000001</longres>
    <geogunit>Decimal degrees</geogunit>
    </geograph>
    <geodetic>
    <horizdn>North American Datum of 1927</horizdn>
    <ellips>Clarke 1866</ellips>
    <semiaxis>6378206.400000</semiaxis>
    <denflat>294.978698</denflat>
    </geodetic>
    </horizsys>
    </spref>
    <eainfo>
    <detailed>
    <enttyp>
    <enttypl>
    cities</enttypl>
    </enttyp>
    <attr>
    <attrlabl>FID</attrlabl>
    <attrdef>Internal feature number.</attrdef>
    <attrdefs>ESRI</attrdefs>
    <attrdomv>
    <udom>Sequential unique whole numbers that are automatically generated.</udom>
    </attrdomv>
    </attr>
    <attr>
    <attrlabl>Shape</attrlabl>
    <attrdef>Feature geometry.</attrdef>
    <attrdefs>ESRI</attrdefs>
    <attrdomv>
    <udom>Coordinates defining the features.</udom>
    </attrdomv>
    </attr>
    <attr>
    <attrlabl>NAME</attrlabl>
    <attrdef>The city name. Spellings are based on Board of Geographic Names standards and commercial atlases.</attrdef>
    <attrdefs>ESRI</attrdefs>
    </attr>
    <attr>
    <attrlabl>COUNTRY</attrlabl>
    <attrdef>An abbreviated country name.</attrdef>
    </attr>
    <attr>
    <attrlabl>POPULATION</attrlabl>
    <attrdef>Total population for the entire metropolitan area. Values are from recent census or estimates.</attrdef>
    </attr>
    <attr>
    <attrlabl>CAPITAL</attrlabl>
    <attrdef>Indicates whether a city is a national capital (Y/N).</attrdef>
    </attr>
    </detailed>
    <overview>
    <eaover>none</eaover>
    <eadetcit>none</eadetcit>
    </overview>
    </eainfo>
    <distinfo>
    <stdorder>
    <digform>
    <digtinfo>
    <transize>0.080</transize>
    </digtinfo>
    </digform>
    </stdorder>
    </distinfo>
    <metainfo>
    <metd>20010509</metd>
    <metc>
    <cntinfo>
    <cntorgp>
    <cntorg>ESRI</cntorg>
    <cntper>unknown</cntper>
    </cntorgp>
    <cntaddr>
    <addrtype>unknown</addrtype>
    <city>unknown</city>
    <state>unknown</state>
    <postal>00000</postal>
    </cntaddr>
    <cntvoice>555-1212</cntvoice>
    </cntinfo>
    </metc>
    <metstdn>FGDC Content Standards for Digital Geospatial Metadata</metstdn>
    <metstdv>FGDC-STD-001-1998</metstdv>
    <mettc>local time</mettc>
    <metextns>
    <onlink>http://www.esri.com/metadata/esriprof80.html</onlink>
    <metprof>ESRI Metadata Profile</metprof>
    </metextns>
    </metainfo>
    </metadata>
    rtacce>Vertical Positional Accuracy is expressed in meters. Vertical accuracy figures were developed by comparing elevation contour locations on 1:24,000 scale maps to elevation values at the same location within the digital database. Some manual interpolation was necessary to complete this test. The analysis results are expressed as linear error at a 90% confidence interval.</vertacce>
    </qvertpa>
    </vertacc>
    </posacc>
    <lineage>
    <srcinfo>
    <srccite>
    <citeinfo>
    <origin>National Imagery and Mapping Agency</origin>
    <pubdate>1994</pubdate>
    <title>Operational Navigational Chart</title>
    <geoform>map</geoform>
    <pubinfo>
    <pubplace>St.Louis, MO</pubplace>
    <publish>National Imagery and Mapping Agency</publish>
    </pubinfo>
    </citeinfo>
    </srccite>
    <srcscale>1000000</srcscale>
    <typesrc>stable-base material</typesrc>
    <srctime>
    <timeinfo>
    <rngdates>
    <begdate>1974</begdate>
    <enddate>1994</enddate>
    </rngdates>
    </timeinfo>
    <srccurr>Publication dates</srccurr>
    </srctime>
    <srccitea>ONC</srccitea>
    <srccontr>All information found on the source with the exception of aeronautical data</srccontr>
    </srcinfo>
    <srcinfo>
    <srccite>
    <citeinfo>
    <origin>National Imagery and Mapping Agency</origin>
    <pubdate>199406</pubdate>
    <title>Digital Aeronautical Flight Information File</title>
    <geoform>model</geoform>
    <pubinfo>
    <pubplace>St. Louis, MO</pubplace>
    <publish>National Imagery and Mapping Agency</publish>
    </pubinfo>
    </citeinfo>
    </srccite>
    <typesrc>magnetic tape</typesrc>
    <srctime>
    <timeinfo>
    <sngdate>
    <caldate>1994</caldate>
    </sngdate>
    </timeinfo>
    <srccurr>Publication date</srccurr>
    </srctime>
    <srccitea>DAFIF</srccitea>
    <srccontr>Airport records (name, International Civil Aviation Organization, position, elevation, and type)</srccontr>
    </srcinfo>
    <srcinfo>
    <srccite>
    <citeinfo>
    <origin>Defense Mapping Agency</origin>
    <pubdate>1994</pubdate>
    <title>Jet Navigational Chart</title>
    <geoform>map</geoform>
    <pubinfo>
    <pubplace>St.Louis, MO</pubplace>
    <publish>Defense Mapping Agency</publish>
    </pubinfo>
    </citeinfo>
    </srccite>
    <srcscale>2,000,000</srcscale>
    <typesrc>stable-base material</typesrc>
    <srctime>
    <timeinfo>
    <rngdates>
    <begdate>1974</begdate>
    <enddate>1991</enddate>
    </rngdates>
    </timeinfo>
    <srccurr>Publication date</srccurr>
    </srctime>
    <srccitea>JNC</srccitea>
    <srccontr>All information found on the source with the exception of aeronautical data. JNCs were used as source for the Antartica region only.</srccontr>
    </srcinfo>
    <srcinfo>
    <srccite>
    <citeinfo>
    <origin>USGS EROS Data Center</origin>
    <pubdate></pubdate>
    <title>Advance Very High Resolution Radiometer</title>
    <geoform>remote-sensing image</geoform>
    <pubinfo>
    <pubplace>Sioux Falls, SD</pubplace>
    <publish>EROS Data Center</publish>
    </pubinfo>
    </citeinfo>
    </srccite>
    <srcscale>1000000</srcscale>
    <typesrc>magnetic tape</typesrc>
    <srctime>
    <timeinfo>
    <rngdates>
    <begdate>199003</begdate>
    <enddate>199011</enddate>
    </rngdates>
    </timeinfo>
    <srccurr>Publication date</srccurr>
    </srctime>
    <srccitea>AVHRR</srccitea>
    <srccontr>6 vegetation types covering the continental US and Canada</srccontr>
    </srcinfo>
    <procstep>
    <procdesc>For the first edition DCW, stable-based positives were produced from the original reproduction negatives (up to 35 per ONC sheet). These were digitized either through a scanning-raster to vector conversion or hand digitized into vector form. The vector data was then tagged with attribute information using ARC-INFO software. Transformation to geographic coordinates was performed using the projection graticules for each sheet. Digital information was edge matched between sheets to create large regional datasets. These were then subdivided into 5 x 5 degree tiles and converted from ARC/INFO to VPF. The data was then pre-mastered for CD-ROM. QC was performed by a separate group for each step in the production process.</procdesc>
    <procdate>199112</procdate>
    <proccont>
    <cntinfo>
    <cntorgp>
    <cntorg>Environmental Systems Research Institute</cntorg>
    </cntorgp>
    <cntpos>Applications Division</cntpos>
    <cntaddr>
    <addrtype>mailing and physical address</addrtype>
    <address>380 New York St.</address>
    <city>Redlands</city>
    <state>CA</state>
    <postal>92373</postal>
    <country>US</country>
    </cntaddr>
    <cntvoice>909-793-2853</cntvoice>
    <cntfax>909-793-5953</cntfax>
    </cntinfo>
    </proccont>
    </procstep>
    <procstep>
    <procdate>199404</procdate>
    <proccont>
    <cntinfo>
    <cntorgp>
    <cntorg>Geonex</cntorg>
    </cntorgp>
    <cntpos></cntpos>
    <cntaddr>
    <addrtype>mailing and physical address</addrtype>
    <address>8950 North 9th Ave.</address>
    <city>St. Petersburg</city>
    <state>FL</state>
    <postal>33702</postal>
    <country>US</country>
    </cntaddr>
    <cntvoice>(813)578-0100</cntvoice>
    <cntfax>(813)577-6946</cntfax>
    </cntinfo>
    </proccont>
    </procstep>
    <procstep>
    <procdesc>Transferred digitally directly into the VPF files.</procdesc>
    <procdate>199408</procdate>
    <proccont>
    <cntinfo>
    <cntorgp>
    <cntorg>Geonex</cntorg>
    </cntorgp>
    <cntpos></cntpos>
    <cntaddr>
    <addrtype>mailing and physical address</addrtype>
    <address>8950 North 9th Ave.</address>
    <city>St. Petersburg</city>
    <state>FL</state>
    <postal>33702</postal>
    <country>US</country>
    </cntaddr>
    <cntvoice>813-578-0100</cntvoice>
    <cntfax>813-577-6946</cntfax>
    </cntinfo>
    </proccont>
    </procstep>
    <procstep>
    <procdesc>Stable-based positives were produced from the original reproduction negatives (up to 35 per ONC sheet). These were digitized either through a scanning-raster to vector conversion or hand digitized into vector form. The vector data was then tagged with attribute information using ARC-INFO software. Transformation to geographic coordinates was performed using the projection graticules for each sheet. Digital information was edge matched between sheets to create large regional datasets. These were then subdivided into 5 x 5 degree tiles and converted from ARC/INFO to VPF. The data was then pre-mastered for CD-ROM. QC was performed by a separate group for each step in the production process.</procdesc>
    <procdate>199112</procdate>
    <proccont>
    <cntinfo>
    <cntorgp>
    <cntorg>Environmental Systems Research Institute</cntorg>
    </cntorgp>
    <cntpos>Applications Division</cntpos>
    <cntaddr>
    <addrtype>mailing and physical address</addrtype>
    <address>380 New York St.</address>
    <city>Redlands</city>
    <state>CA</state>
    <postal>92373</postal>
    <country>US</country>
    </cntaddr>
    <cntvoice>909-793-2853</cntvoice>
    <cntfax>909-793-5953</cntfax>
    </cntinfo>
    </proccont>
    </procstep>
    <procstep>
    <procdesc>Daily AVHRR images were averaged for two week time periods over the entire US growing season. These averaged images, their rates of change, elevation information, and other data were used to produce a single land classification image of the contental US. The VMap-0 data set extended this coverage over the Canadian land mass, however vegetation classification was further subdivided into nine vegetation types.</procdesc>
    <procdate>199402</procdate>
    <srcprod>EROS data</srcprod>
    <proccont>
    <cntinfo>
    <cntorgp>
    <cntorg>USGS Eros Data Center</cntorg>
    </cntorgp>
    <cntpos></cntpos>
    <cntaddr>
    <addrtype>mailing and physical address</addrtype>
    <address></address>
    <city>Sioux Falls</city>
    <state>SD</state>
    <postal></postal>
    <country>US</country>
    </cntaddr>
    <cntvoice></cntvoice>
    <cntfax></cntfax>
    </cntinfo>
    </proccont>
    </procstep>
    <procstep>
    <procdesc>The Eros data (raster files) were converted to vector polygon, splined (remove stairstepping), thinned (all ploygons under 2km2 were deleted), and tied to existing DCW polygons (water bodies, built-up areas). The resulting file was tiled and converted to a VPF Vegetation coverage for use in the DCW. All processing was performed using ARC-INFO software.</procdesc>
    <procdate>199412</procdate>
    <srcprod>VMap-0 Vegetation Coverage</srcprod>
    <proccont>
    <cntinfo>
    <cntorgp>
    <cntorg>Geonex</cntorg>
    </cntorgp>
    <cntpos></cntpos>
    <cntaddr>
    <addrtype>mailing and physical address</addrtype>
    <address>8950 North 9th Ave.</address>
    <city>St. Petersburg</city>
    <state>FL</state>
    <postal>33702</postal>
    <country>US</country>
    </cntaddr>
    <cntvoice>813-578-0100</cntvoice>
    <cntfax>813-577-6946</cntfax>
    </cntinfo>
    </proccont>
    </procstep>
    <procstep>
    <procdesc>Data was translated from VPF format to ArcInfo Coverage format. The coverages were then loaded into a seamless ArcSDE layer.</procdesc>
    <procdate>02152001</procdate>
    <proccont>
    <cntinfo>
    <cntorgp>
    <cntorg>Geodesy Team, Harvard University</cntorg>
    </cntorgp>
    <cntemail>[email protected]</cntemail>
    </cntinfo>
    </proccont>
    </procstep>
    </lineage>
    </dataqual>
    <spdoinfo>
    <direct>Vector</direct>
    <ptvctinf>
    <sdtsterm>
    <sdtstype>Complete chain</sdtstype>
    </sdtsterm>
    <sdtsterm>
    <sdtstype>Label point</sdtstype>
    </sdtsterm>
    <sdtsterm>
    <sdtstype>GT-polygon composed of chains</sdtstype>
    </sdtsterm>
    <sdtsterm>
    <sdtstype>Point</sdtstype>
    </sdtsterm>
    <vpfterm>
    <vpflevel>3</vpflevel>
    <vpfinfo>
    <vpftype>Node</vpftype>
    </vpfinfo>
    <vpfinfo>
    <vpftype>Edge</vpftype>
    </vpfinfo>
    <vpfinfo>
    <vpftype>Face</vpftype>
    </vpfinfo>
    </vpfterm>
    </ptvctinf>
    </spdoinfo>
    <spref>
    <horizsys>
    <geograph>
    <latres>0.000000</latres>
    <longres>0.000000</longres>
    <geogunit>Decimal degrees</geogunit>
    </geograph>
    <geodetic>
    <horizdn>D_WGS_1984</horizdn>
    <ellips>WGS_1984</ellips>
    <semiaxis>6378137.000000</semiaxis>
    <denflat>298.257224</denflat>
    </geodetic>
    </horizsys>
    <vertdef>
    <altsys>
    <altdatum>Mean Sea Level</altdatum>
    <altunits>1.0</altunits>
    </altsys>
    </vertdef>
    </spref>
    <eainfo>
    <detailed>
    <enttyp>
    <enttypl>
    lc.pat</enttypl>
    </enttyp>
    <attr>
    <attrlabl>FID</attrlabl>
    <attrdef>Internal feature number.</attrdef>
    <attrdefs>ESRI</attrdefs>
    <attrdomv>
    <udom>Sequential unique whole numbers that are automatically generated.</udom>
    </attrdomv>
    </attr>
    <attr>
    <attrlabl>Shape</attrlabl>
    <attrdef>Feature geometry.</attrdef>
    <attrdefs>ESRI</attrdefs>
    <attrdomv>
    <udom>Coordinates defining the features.</udom>
    </attrdomv>
    </attr>
    <attr>
    <attrlabl>AREA</attrlabl>
    <attrdef>Area of feature in internal units squared.</attrdef>
    <attrdefs>ESRI</attrdefs>
    <attrdomv>
    <udom>Positive real numbers that are automatically generated.</udom>
    </attrdomv>
    </attr>
    <attr>
    <attrlabl>PERIMETER</attrlabl>
    <attrdef>Perimeter of feature in internal units.</attrdef>
    <attrdefs>ESRI</attrdefs>
    <attrdomv>
    <udom>Positive real numbers that are automatically generated.</udom>
    </attrdomv>
    </attr>
    <attr>
    <attrlabl>LC#</attrlabl>
    <attrdef>Internal feature number.</attrdef>
    <attrdefs>ESRI</attrdefs>
    <attrdomv>
    <udom>Sequential unique whole numbers that are automatically generated.</udom>
    </attrdomv>
    </attr>
    <attr>
    <attrlabl>LC-ID</attrlabl>
    <attrdef>User-defined feature number.</attrdef>
    <attrdefs>ESRI</attrdefs>
    </attr>
    <attr>
    <attrlabl>LCAREA.AFT_ID</attrlabl>
    </attr>
    <attr>
    <attrlabl>LCPYTYPE</attrlabl>
    <attrdef>Land cover poygon type</attrdef>
    <attrdefs>NIMA</attrdefs>
    <attrdomv>
    <edom>
    <edomv>1</edomv>
    <edomvd>Rice Field</edomvd>
    </edom>
    <edom>
    <edomv>2</edomv>
    <edomvd>Cranberry bog</edomvd>
    </edom>
    <edom>
    <edomv>3</edomv>
    <edomvd>Cultivated area, garden</edomvd>
    </edom>
    <edom>
    <edomv>4</edomv>
    <edomvd>Peat cuttings</edomvd>
    </edom>
    <edom>
    <edomv>5</edomv>
    <edomvd>Salt pan</edomvd>
    </edom>
    <edom>
    <edomv>6</edomv>
    <edomvd>Fish pond or hatchery</edomvd>
    </edom>
    <edom>
    <edomv>7</edomv>
    <edomvd>Quarry, strip mine, mine dump, blasting area</edomvd>
    </edom>
    <edom>
    <edomv>8</edomv>
    <edomvd>Oil or gas</edomvd>
    </edom>
    <edom>
    <edomv>10</edomv>
    <edomvd>Lava flow</edomvd>
    </edom>
    <edom>
    <edomv>11</edomv>
    <edomvd>Distorted surface area</edomvd>
    </edom>
    <edom>
    <edomv>12</edomv>
    <edomvd>Unconsolidated material (sand or gravel, glacial moraine)</edomvd>
    </edom>
    <edom>
    <edomv>13</edomv>
    <edomvd>Natural landmark area</edomvd>
    </edom>
    <edom>
    <edomv>14</edomv>
    <edomvd>Inundated area</edomvd>
    </edom>
    <edom>
    <edomv>15</edomv>
    <edomvd>Undifferentiated wetlands</edomvd>
    </edom>
    <edom>
    <edomv>99</edomv>
    <edomvd>None</edomvd>
    </edom>
    </attrdomv>
    </attr>
    <attr>
    <attrlabl>TILE_ID</attrlabl>
    <attrdef>VPF Format tile ID</attrdef>
    <attrdefs>NIMA</attrdefs>
    </attr>
    <attr>
    <attrlabl>FAC_ID</attrlabl>
    </attr>
    </detailed>
    <overview>
    <eaover>The DCW used a product-specific attribute coding system that is composed of TYPE and STATUS designators for area, line, and point features; and LEVEL and SYMBOL designators for text features. The TYPE attribute specifies what the feature is, while the STATUS attribute specifies the current condition of the feature. Some features require both a TYPE and STATUS code to uniquely identify their characteristics. In order to uniquely identify each geographic attribute in the DCW, the TYPE and STATUS attribute code names are preceded by the two letter coverage abbreviation and a two letter abbreviation for the type of graphic primitive present. The DCW Type/Status codes were mapped into the FACC coding scheme. A full description of FACC may be found in Digital Geographic Information Exchange Standard Edition 1.2, January 1994.</eaover>
    <eadetcit>Entities (features) and Attributes for DCW are fully described in: Department of Defense, 1992, Military Specification Digital Chart of the World (MIL-D-89009): Philadelphia, Department of Defense, Defense Printing Service Detachment Office.</eadetcit>
    </overview>
    </eainfo>
    <distinfo>
    <distrib>
    <cntinfo>
    <cntorgp>
    <cntorg>NIMA</cntorg>
    </cntorgp>
    <cntpos>ATTN: CC, MS D-16</cntpos>
    <cntaddr>
    <addrtype>mailing and physical address</addrtype>
    <address>6001 MacArthur Blvd.</address>
    <city>Bethesda</city>
    <state>MD</state>
    <postal>20816-5001</postal>
    <country>US</country>
    </cntaddr>
    <cntvoice>301-227-2495</cntvoice>
    <cntfax>301-227-2498</cntfax>
    </cntinfo>
    </distrib>
    <distliab>None</distliab>
    <stdorder>
    <digform>
    <digtinfo>
    <formname>VPF</formname>
    <formverd>19930930</formverd>
    <formspec>Military Standard Vector Product Format (MIL-STD-2407). The current version of this document is dated 28 June 1996. Edition 3 of VMap-0 conforms to a previous version of the VPF Standard as noted. Future versions of VMap-0 will conform to the current version of VPF Standard.</formspec>
    <transize>0.172</transize>
    </digtinfo>
    <digtopt>
    <offoptn>
    <offmedia>CD-ROM</offmedia>
    <recfmt>ISO 9660</recfmt>
    </offoptn>
    </digtopt>
    </digform>
    <fees>Not Applicable</fees>
    </stdorder>
    </distinfo>
    <distinfo>
    <distrib>
    <cntinfo>
    <cntorgp>
    <cntorg>USGS Map Sales</cntorg>
    </cntorgp>
    <cntaddr>
    <addrtype>mailing address</addrtype>
    <address>Box 25286</address>
    <city>Denver</city>
    <state>CO</state>
    <postal>80225</postal>
    <country>US</country>
    </cntaddr>
    <cntvoice>303-236-7477</cntvoice>
    <cntfax>303-236-1972</cntfax>
    </cntinfo>
    </distrib>
    <distliab>None</distliab>
    <stdorder>
    <digform>
    <digtinfo>
    <transize>0.172</transize>
    </digtinfo>
    </digform>
    <fees>$82.50 per four disk set</fees>
    <ordering>For General Public: Payment (check, money order, purchase order, or Government account) must accompany order.
    Make all drafts payable to Dept. of the Interior- US Geological Survey.
    To provide a general idea of content, a sample data set is available from the TMPO Home Page at:</ordering>
    </stdorder>
    </distinfo>
    <distinfo>
    <distrib>
    <cntinfo>
    <cntorgp>
    <cntorg>Geodesy Team, Harvard University</cntorg>
    <cntper>Geodesy Team</cntper>
    </cntorgp>
    <cntemail>[email protected]</cntemail>
    </cntinfo>
    </distrib>
    <resdesc>Geodesy layer</resdesc>
    <distliab>None</distliab>
    <stdorder>
    <digform>
    <digtinfo>
    <formname>SHP</formname>
    <transize>0.172</transize>
    </digtinfo>
    <digtopt>
    <onlinopt>
    <computer>
    <networka>
    <networkr>geodesy.harvard.edu</networkr>
    </networka>
    </computer>
    </onlinopt>
    </digtopt>
    </digform>
    <fees>none</fees>
    </stdorder>
    <availabl>
    <timeinfo>
    <sngdate>
    <caldate>1992</caldate>
    </sngdate>
    </timeinfo>
    </availabl>
    </distinfo>
    <metainfo>
    <metd>20010226</metd>
    <metc>
    <cntinfo>
    <cntorgp>
    <cntorg>Geodesy Team</cntorg>
    <cntper>REQUIRED: The person responsible for the metadata information.</cntper>
    </cntorgp>
    <cntvoice>REQUIRED: The telephone number by which individuals can speak to the organization or individual.</cntvoice>
    <cntemail>[email protected]</cntemail>
    </cntinfo>
    </metc>
    <metstdn>FGDC Content Standards for Digital Geospatial Metadata</metstdn>
    <metstdv>FGDC-STD-001-1998</metstdv>
    <mettc>local time</mettc>
    <metextns>
    <onlink>http://www.esri.com/metadata/esriprof80.html</onlink>
    <metprof>ESRI Metadata Profile</metprof>
    </metextns>
    </metainfo>
    </metadata>

    Have you tired the directory and bfile methods? Here is the example for that in the Oracle XML Developer's Guide:
    CREATE DIRECTORY xmldir AS 'path_to_folder_containing_XML_file';
    Example 3-3 Inserting XML Content into an XMLType Table
    INSERT INTO mytable2 VALUES (XMLType(bfilename('XMLDIR', 'purchaseOrder.xml'),
    nls_charset_id('AL32UTF8')));
    1 row created.
    The value passed to nls_charset_id() indicates that the encoding for the file to be read is UTF-8.
    ben

Maybe you are looking for