|
Code Listing 6: Retrieving XML documents by using XDBUriType
SQL> SELECT XDBUriType(any_path).getXML()
2 FROM resource_view
3 WHERE under_path(res,'/CD')=1
4 AND extractValue(res,'/Resource/ContentType')='text/xml';
XDBURITYPE(ANY_PATH).GETXML()
------------------------------------
<CD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="cd.xsd">
<Title>Legends of the Great Lakes</Title>
<Artist>Carl Behrend</Artist>
<Website>http://greatlakeslegends.com</Website>
...
SQL> SELECT XDBUriType(any_path || '#/CD/Title/text()').getXML() title
2 FROM resource_view
3 WHERE under_path(res,'/CD')=1
4 AND extractValue(res,'/Resource/ContentType')='text/xml';
------------------------------------
Nothing Less
Legends of the Great Lakes
|