OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XPath: how to select based on element type?



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/     **
     \\//
     //\\
    //  \\