[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] the OTHER attributes with XPath


Subject: RE: [xsl] the OTHER attributes with XPath
From: Ben Fry <Ben_Fry@xxxxxxxxxxxxx>
Date: Tue, 16 Jul 2002 11:02:26 +0100

How About
	xpath: //PERSON/@*[name() != 'NAME']

Cheers,
Ben

-----Original Message-----
From: Daniel N. Javastark [mailto:djavastark@xxxxxxxxxxxxxxxxxxxxxxxx]
Sent: 16 July 2002 10:36
To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] the OTHER attributes with XPath


Hi, I'm trying to pull off all the OTHER attributes than one with a
particular name from, for example, this xml snippet:

<PERSON NAME="JUAN LUIS" UNIQUEID="A" HEIGHT_CATEGORY="2" SEX="M">

Let's say I want to get all the attributes except for "NAME": "UNIQUEID",
"HEIGHT_CATEGORY", and "SEX".

I can pull off the "PERSON" node which contains an attribute named "NAME":

	xpath: //PERSON[name(@NAME)='NAME']

or any "PERSON" node that does NOT contain the attribute "NAME":

	xpath: //PERSON[not(name(@NAME)='NAME')]

or all the attributes of "PERSON":

	xpath: //PERSON/@*

but I don't know how to get all the attributes except "NAME".

Is there any way to do this?  In XSL using or programatically I can do it by
iterating through the attributes, of course, but if there's a way to do it
with XPath, great.

Thanks,
Dan



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
=====================================================================
DISCLAIMER

1. The information contained in this E-mail is confidential. 
   It is intended only for the stated addressee(s) and access 
   to it by any other person is unauthorised. 
   If you are not an addressee, you must not disclose, copy, 
   circulate or in any other way use or rely on the information 
   contained in this E-mail. Such unauthorised use may be unlawful. 
   If you have received this E-mail in error, please inform us 
   immediately and delete it and all copies from your system.

2. The views expressed in this E-mail are those of the author, 
    and do not represent the views of AMT-Sybex Group Ltd., its 
    associates or subsidiaries, unless otherwise expressly indicated.
    In the avoidance of doubt, the insertion of the name of AMT-Sybex 
    Group Ltd., its associate or subsidiary under the name of the sender 
    may constitute an express indication that the views stated in the Mail 
    are those of the named company.
=====================================================================
For more information on the AMT Sybex group visit: http://www.amt-sybex.com 



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords