• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 397
  • Last Modified:

ORACLE DOM

childnode DBMS_XMLDOM.DOMNode;

childnode := DBMS_XMLDOM.item(child_nodelist, 0);

--childnode contains

<root>
<row><cell>a</cell></row>
<row><cell>b</cell></row>
<row><cell>c</cell></row>
</root>

I want to achieve at least one of the following:

1) convert the childnode to XMLTYPE?

2) convert the childnode to CLOB?

 

Thanks
0
eugeneca
Asked:
eugeneca
2 Solutions
 
slightwv (䄆 Netminder) Commented:
1) You might need to convert the node to a document/element first but look at:  DBMS_XMLDOM.GETXMLTYPE

http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/d_xmldom.htm#i1124847

2) use DBMS_XMLDOM.WRITETOCLOB

http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/d_xmldom.htm#i1078527
0
 
paquicubaCommented:
As slightwv mentioned above, you have to have a document in order to return DBMS_XMLDOM.GETXMLTYPE(<your document here>)

Something like this:

xml_doc                      dbms_xmldom.domdocument;

      -- Create handle for new XML doc
      xml_doc := dbms_xmldom.newdomdocument;
     
      -- Set the prologue
      dbms_xmldom.setversion(xml_doc, p_xml_version);
     
      -- Make the root node
      root_node := dbms_xmldom.makenode(xml_doc);

     -- Then append the childnode to the rootnode
     dbms_xmldom.appendchild(root_node, child_elmt_node);

It's more complex than the steps above, but you get the idea...
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now