[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: XPath: how to select based on element type?
- From: Matt Sergeant <matt@sergeant.org>
- To: Sankaranarayanan K V <sankar@migv.mot.com>
- Date: Mon, 08 Jan 2001 10:33:26 +0000 (GMT)
On Mon, 8 Jan 2001, Sankaranarayanan K V wrote:
> Hi,
>
> I am fairly new to XPath and XML schema.
> I have a couple of newbie questions:
>
> (1) Is there a way a in XPath to select nodes based on their element type?
Element type is not a term I recognise. Perhaps you either mean node type
or element name. Either way:
//comment() (select all comments)
//text() (select all text nodes)
//* (select all elements)
//processing-instruction() (select all PI's)
And if you mean element name:
//*[name() = 'foo' or name() = 'bar']
Hope that helps.
--
<Matt/>
/|| ** Director and CTO **
//|| ** AxKit.com Ltd ** ** XML Application Serving **
// || ** http://axkit.org ** ** XSLT, XPathScript, XSP **
// \\| // ** Personal Web Site: http://sergeant.org/ **
\\//
//\\
// \\