Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ora/xml_util_pkg.pkb to fix #27 #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

datRedHeadedGuy
Copy link
Contributor

Modified the xml_util_pkg and changed the use of XMLType.extract(xpath).getStringVal() to EXTRACTVALUE(XMLType, xpath) so that special characters are not escaped.

Modified the xml_util_pkg and changed the use of XMLType.extract(xpath).getStringVal() to EXTRACTVALUE(XMLType, xpath) so that special characters are not escaped.
@mortenbra
Copy link
Owner

Hesitant to approve this, as the EXTRACTVALUE function has been deprecated since at least Oracle 11.2 (see https://docs.oracle.com/cd/E11882_01/server.112/e41084/functions061.htm#SQLRF06173 ).

Can you describe the problem in more detail?

@eaolson
Copy link
Contributor

eaolson commented Sep 23, 2019

Example:

declare
    x xmltype;
    ex varchar2(100);
begin
    x := xmltype ('<root><foo bar="three &amp; four">one &amp; two</foo></root>');
    ex := xml_util_pkg.extract_value( x, '/root/foo/text()' );
    dbms_output.put_line( ex );
    ex := xml_util_pkg.extract_value( x, '/root/foo/@bar' );
    dbms_output.put_line( ex );
end;

Returns:

one &amp; two
three &amp; four

Wouldn't the expected result have the & unescaped to just "&"? Would calling dbms_xmlgen.convert() be a better solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants