Bug #16321 XML: extractvalue() navigation problem
Submitted: 10 Jan 2006 0:31 Modified: 2 Mar 2006 8:29
Reporter: Peter Gulutzan
Status: Closed
Category:Server: XML Severity:S3 (Non-critical)
Version:5.1.5-alpha-debug OS:Linux (SUSE 10.0)
Assigned to: Alexander Barkov Target Version:

[10 Jan 2006 0:31] Peter Gulutzan
Description:
With extractvalue(), if I navigate to the root, up from the root,
then down (which should take me back to the root),
I get nothing. This is true for /.. and for
/descendant::*/ancestor::*.. By analogy with
Unix, e.g. "cd /../var", I think such a thing
should be possible.

How to repeat:
mysql> select extractvalue('<a>A<b>B</b></a>','/../a');
+------------------------------------------+
| extractvalue('<a>A<b>B</b></a>','/../a') |
+------------------------------------------+
|                                          |
+------------------------------------------+
1 row in set (0.00 sec)
[10 Jan 2006 0:53] Miguel Solorzano
mysql> select extractvalue('<a>A<b>B</b></a>','/../a');
+------------------------------------------+
| extractvalue('<a>A<b>B</b></a>','/../a') |
+------------------------------------------+
|                                          |
+------------------------------------------+
1 row in set (0.01 sec)
[1 Mar 2006 11:07] Alexander Barkov
Oracle behaves the same. So I guess we can close as not a bug:

SQL> select sys.xmltype.getclobval(sys.xmltype.extract(x,'/a')) from t1;

SYS.XMLTYPE.GETCLOBVAL(SYS.XMLTYPE.EXTRACT(X,'/A'))
--------------------------------------------------------------------------------
<a>
A  <b>B</b>
</a>

SYS.XMLTYPE.GETCLOBVAL(SYS.XMLTYPE.EXTRACT(X,'/../A'))
--------------------------------------------------------------------------------

To doc team: consider documenting this behaviour, then close as "not a bug". Thanks!
[2 Mar 2006 8:29] Jon Stephens
Thank you for your bug report. This issue has been addressed in the
documentation. The updated documentation will appear on our website
shortly, and will be included in the next release of the relevant
product(s).

Additional info:

Updated documentation relating to limitations of XPath functions. Closed.