snippetMinor
Generate lower case tag names with Oracle DBMS_XMLGEN?
Viewed 0 times
casetaglowerwithnamesgenerateoracledbms_xmlgen
Problem
I am generating XML in Oracle PL/SQL with the DBMS_XMLGEN package:
My problem is that whatever I do I always get the tag names in upper case. To maintain compatibility with things further downstream, I need them to be in lower case. Is there any way I can fix this?
I know there is an option for this in DBMS_XMLQUERY, but the docs says it is not recommended to use that package.
OPEN base_cursor FOR SELECT * FROM foo;
base_context := dbms_xmlgen.newcontext(base_cursor);
base_xml := dbms_xmlgen.getxmltype(base_context, dbms_xmlgen.none);My problem is that whatever I do I always get the tag names in upper case. To maintain compatibility with things further downstream, I need them to be in lower case. Is there any way I can fix this?
I know there is an option for this in DBMS_XMLQUERY, but the docs says it is not recommended to use that package.
Solution
According to ORACLE-BASE,
Where possible DBMS_XMLGEN should be used as it is more efficient than using the Java based DBMS_XMLQUERY
And:
The example below is a copy of the previous code with all references to DBMS_XMLQUERY replaced by references to DBMS_XMLGEN. Note that two of the lines have been commented out as this functionality is currently not present in DBMS_XMLGEN
I added my emphasis, because this refers specifically to the
So it looks like you are stuck with the slower DBMS_XMLQUERY.
Where possible DBMS_XMLGEN should be used as it is more efficient than using the Java based DBMS_XMLQUERY
And:
The example below is a copy of the previous code with all references to DBMS_XMLQUERY replaced by references to DBMS_XMLGEN. Note that two of the lines have been commented out as this functionality is currently not present in DBMS_XMLGEN
I added my emphasis, because this refers specifically to the
settagcase you are looking for.--DBMS_XMLGEN.settagcase(v_ctx, DBMS_XMLGen.LOWER_CASE);So it looks like you are stuck with the slower DBMS_XMLQUERY.
Code Snippets
--DBMS_XMLGEN.settagcase(v_ctx, DBMS_XMLGen.LOWER_CASE);Context
StackExchange Database Administrators Q#150493, answer score: 3
Revisions (0)
No revisions yet.