Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

dbms_xmldom domnode value

530121Aug 25 2006
Is there any way of setting the value of a regular domnode with appending a domtext child node? I found that a domtext node will not accept attributes, and a domnode will not accept a value, I need to do both. Want to create the following:

<item text="Accounting" >
<userdata name="MyName">sfvsf</userdata>
</item>

This is where I am now. This code:.

l_element := xmldom.createElement(p_doc, 'item');
xmldom.setAttribute(l_element, 'text', "Accounting");

--create the node
l_tab_node := xmldom.appendChild(p_menu_node
,xmldom.makeNode(l_element));

--child node
l_child_element := xmldom.createElement(p_doc, 'userdata');
l_child_node := xmldom.appendChild(l_tab_node,xmldom.makeNode(l_child_element));

l_text_node := xmldom.appendChild(l_child_node ,xmldom.makeNode(l_text));
xmldom.setNodeValue(l_text_node ,'sfvsf');

Produces:
<item text="Accounting" >
<userdata>sfvsf</userdata>
</item>

TIA,
Buzz
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 22 2006
Added on Aug 25 2006
0 comments
248 views