W3C home > Mailing lists > Public > www-ql@w3.org > January to March 2004

RE: Questions related to XPath 2.0

From: Kay, Michael <Michael.Kay@softwareag.com>
Date: Mon, 26 Jan 2004 12:41:46 +0100
Message-ID: <37B64F4BA60E9E4FB9F60929E0598024287804@DAEMSG03.eur.ad.sag>
To: "Murali Mani" <mani@CS.UCLA.EDU>
Cc: <www-ql@w3.org>

> > > 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
Received on Monday, 26 January 2004 06:41:27 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 22 July 2006 00:10:19 GMT