[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

not-having-attribute

Subject: not-having-attribute
From: Kyle Downey <kyle.downey@xxxxxxxxxxxxxxx>
Date: 26 Feb 00 18:07:10 EST
xpath not having attribute
From the XPath specification, I know 

para[@type = "warning"]

selects all para nodes with an attribute type = "warning." Similarly, 

para[@type]

selects all para nodes with a type attribute. Is it possible to get an
inversion of the latter? i.e. "all para nodes that do NOT contain a type
attribute OR nodes that contain a value not equal to warning?"

My source is like this (roughly):

<fields>
  <field id="foo" pkey="true"/>
  <field id="foo2/>
</fields>

I want to select all non-pkey field nodes, but this search

fields/field[@pkey != 'true']

results in an empty set because it's only taking into consideration nodes that
have a value at all. From the note at the end of XPath section 5.3
(http://www.w3.org/TR/1999/REC-xpath-19991116.html#attribute-nodes) I gather
that I need to use a validating XML parser if I want this to work at all.

Okay, so I can put in pkey = false on the input, or I need to always use a DTD
and validating parser. Fine. But is there a way to do it with a non-validating
parser for speed and to not have this (perhaps not immediately apparent)
dependency on a validating parser for my stylesheet?

regards,
kd





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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.