dbms_xmldom domnode value
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