RE: Questions related to XPath 2.0

"Kay, Michael" <[email protected]>
Newsgroups gmane.comp.web.query-languages
Message-ID <[email protected]>
> > > 2. I was looking at fn:id (string) and fn:idref (string). 
> How do I 
> > > use it, say if I get a list of values of idref attributes. An 
> > > example that I may think of is a schema (rough
> > > DTD) like:
> > >
> > > <!ATTLIST Professor (pname, office, pid)>
> > > <!ATTLIST Student (sname, major, advisor)>
> > >
> > > advisor is an IDREF attribute, pid is ID attribute.
> 
> This is my desired output: I want to find the name of 
> advisors of students who are CS majors. I would like to not 
> do joins, but try to use fn:id
> 

If I understand your data this is simply
id(//Student[major='CS']/advisor), exactly as in XPath 1.0.

Michael Kay
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.