Hi,
I'm trying to figure out when it's a good idea to use or not use dbms_xmlparser. It seems like I can create a domDocument without needing a parser, but most examples I see online use a parse. Something like this:
However, it's possible to get the same result by leaving out the parser, and just doing:
When is it appropriate to use the parser? Does one do better than the other for small and/or large result sets?
Thanks,
Mike
I'm trying to figure out when it's a good idea to use or not use dbms_xmlparser. It seems like I can create a domDocument without needing a parser, but most examples I see online use a parse. Something like this:
Code:
OPEN emp_refcur FOR
SELECT *
FROM employees;
xml_ctx := dbms_xmlgen.newContext(emp_refcur);
xml_parser := dbms_xmlparser.newParser;
dbms_xmlparser.parseCLOB(xml_parser, dbms_xmlgen.getXml(xml_ctx));
xml_dom := dbms_xmlparser.getDocument(xml_parser);
dbms_xmlparser.freeParser(xml_parser);
row_node_list := dbms_xmldom.getElementsByTagName(xml_dom, 'ROW');
However, it's possible to get the same result by leaving out the parser, and just doing:
Code:
OPEN emp_refcur FOR
SELECT *
FROM employees;
xml_ctx := dbms_xmlgen.newContext(emp_refcur);
xml_dom := dbms_xmldom.newDOMDocument(dbms_xmlgen.getXml(xml_ctx));
row_node_list := dbms_xmldom.getElementsByTagName(xml_dom, 'ROW');
When is it appropriate to use the parser? Does one do better than the other for small and/or large result sets?
Thanks,
Mike