Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What is the easiest way to get the value of a DOM element?

DOM easiest element value
0
Posted

What is the easiest way to get the value of a DOM element?

0

Question: I have problems when I get a value from XML. I work with XMLDOM and PLSQL (ORACLE 8i). This is my code (it works ok): begin x_parser := xmlparser(x_parser,v_xml); xmlparser.parserbuffer(x_parser,v_xml); x_doc := xmlparser.getdocument(x_parser); x_node_list := xmldom.getElementsbytagname(x_doc,’*’); x_node := xmldom.item(x_node_list,2); — look this x_node := xmldom.getfirstchild(x_node); v_value := xmldom.getNodeValue(x_node); end I don’t want to use index to get a value I must use node’s name. In my code I use index 2 but I want to use a tag ‘NAME’ (node’s name). and my xml is TONY M 01/12/2001 Answer: You can use xpath to get the value of your element. Here is the example. The try.xml just be your input XML file: PL/SQL: declare parser xmlparser.parser; doc xmldom.DOMDocument; node xmldom.DOMNode; elem xmldom.DOMElement; value varchar2(50); begin parser := xmlparser.newparser; xmlparser.parse

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123