RE: following/preceding-sibling shorthands in XPath 2.0

"Paul Cotton" <[email protected]> Wed, 17 Nov 2004 06:15:00 -0800
Newsgroups gmane.text.xml.xpath.general
Message-ID <33D970235519324D988AFFDE7EA2E24C028FF225@RED-MSG-41.redmond.corp.microsoft.com>
Please send your XPath 2.0 comments to [email protected] as per
the directions in the draft XPath 2.0 specification [1].

/paulc

[1] http://www.w3.org/TR/2004/WD-xpath20-20041029/

Paul Cotton, Microsoft Canada=20
17 Eleanor Drive, Nepean, Ontario K2E 6A3=20
Tel: (613) 225-5445 Fax: (425) 936-7329=20
mailto:[email protected]

 =20

> -----Original Message-----
> From: [email protected] [mailto:www-xpath-comments-
> [email protected]] On Behalf Of Laurens Holst
> Sent: November 17, 2004 8:31 AM
> To: [email protected]
> Subject: following/preceding-sibling shorthands in XPath 2.0
>=20
>=20
> What about creating shorthands for following-sibling and
> preceding-sibling in XPath 2.0?
>=20
> following-sibling::chapter[fn:position() =3D 1] could be
> +chapter[1]
>=20
> and
>=20
> preceding-sibling::chapter[fn:position() =3D 1] could be
> -chapter[1]
>=20
> Neither + or - are legal characters to start an XML element name with,
> so I think this syntax is possible. Other usage examples would be +[1]
> and -[1] for +*[1] and -*[1].
>=20
> In my company's product we have changed from our own targeting method
to
> XPath (shorthand notation), and this is one thing we're missing. We
use
> these selectors so often that we currently defined our own syntax for
it
> ('~+chapter[1]' and '~-chapter[1]'), but we would prefer to use a
> standardized method.
>=20
>=20
> ~Grauw
>=20
> --
> Ushiko-san! Kimi wa doushite, Ushiko-san nan da!!