Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: XDK XPath examples needed
roger <rsr_at_rogerware.com> wrote in message news:<J5jp9.42259$7I6.129808_at_rwcrnsc52.ops.asp.att.net>...
> Hello,
> I'm using the latest XDK 'C' api to parse XML documents.
> Now that I have one parsed, I'd like to be able to navigate
> it, using XPath expressions.
>
> There are XPath related functions in the API (xp* described in the XSLT API
> document) but the documentation is very thin and there seem to be no
> samples in the XDK that illustrate the use of these functions.
>
> Anyone know where I can look to see how to use these functions?
>
> What I am trying to do is parse a largeish XML document as a DOM tree, then
> as needed, quickly locate various nodes using various XPath searches.
> That should be possible - right?
>
> If I'm going about this the wrong way, how should I approach the problem?
>
>
>
> Thanks,
> Roger
Roger,
This is very interesting you are trying to perform similar functionality. I've been doing some XPath search testing lately but came up with a bit of an issue with Oracle Relation Database Model. What concerns me most, is XML can be unnormalised, variable data. i.e. you could store a completed database structure in a single record. i.e. All Libarary books in a single LIBRARY record.
e.g. <library</book><book>Cameras<author>John Smith</author><author>Billy Bob</author></book></library>
If this record was stored in a single table called... LIBRARIES and I was to query for all DISTINCT authors. My result would look like the following
SELECT distinct(l.data.extract('/library/book/author/text()').getStringVal)) "Author" FROM Libraries l;
John SmithBilly Bob
1 row selected
To get DISTINCT authors, you'd have to normalise the record into Libraries, Books and Authors table. I think Oracle need to think a little bit more outside the box.
Sorry, not really relevant to your post... but I thought you'd be interested.
Cheers,
Greg Received on Fri Oct 11 2002 - 00:08:39 CDT
![]() |
![]() |