My Oracle Support Banner

XMLPARSER RETURNING UNEXPECTED RESULTS (Doc ID 2485563.1)

Last updated on JANUARY 16, 2019

Applies to:

Oracle Database - Enterprise Edition - Version 12.2.0.1 and later
Information in this document applies to any platform.

Symptoms

DECLARE
   V_WK_CD      CHAR(8);
   V_CTX                       dbms_xmlsave.ctxType;
   V_PARSER                    xmlparser.Parser;
   V_DOC                       xmldom.DOMDocument;
   V_NODELIST                  xmldom.DOMNodeList;
   V_NODE                      xmldom.DOMNode;
   V_NODEGRID                  xmldom.DOMNodeList;
   V_G_NODE                    xmldom.DOMNode;

BEGIN
   V_WK_CD := '1';
   
   V_PARSER                    := xmlparser.newParser;
   xmlparser.parseClob(V_PARSER, '<ROWSET><ROW><gb></gb></ROW></ROWSET>');
   V_DOC                       := xmlparser.getDocument(V_PARSER);
   xmlparser.freeParser(V_PARSER);

   --Get node list
   V_NODELIST := xslprocessor.selectNodes(xmldom.makeNode(V_DOC),'//ROWSET/ROW');
   --V_NODEGRID := xslprocessor.selectNodes(xmldom.makeNode(V_DOC),'//ROWSET/GRID');
   --get node
   FOR idx IN 0 .. xmldom.getLength(V_NODELIST) - 1 LOOP
       V_NODE                              := xmldom.item(V_NODELIST, idx);
       V_WK_CD                             := xslprocessor.valueOf(V_NODE, 'gb');
       --                             xslprocessor.valueOf(V_NODE, 'gb', V_WK_CD);
   END LOOP;    
   
   DBMS_OUTPUT.PUT_LINE('V_WK_CD_01     : [' || V_WK_CD || ']');
   DBMS_OUTPUT.PUT_LINE('V_WK_CD_02     : [' || LENGTHB(V_WK_CD) || ']');
END;


result value
1) 9i 
V_WK_CD_01     : []
V_WK_CD_02     : []
2) 12cR2
V_WK_CD_01     : [        ]
V_WK_CD_02     : [8]

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.