xsl-list
[Top] [All Lists]

RE: [xsl] How to produce X when an attribute of an element does not exist orequals Y?

2008-07-09 00:22:37
Hi, I'm new to the listserv and to XSL. Using the XML below 
and XSLT 1.0, I would like content to appear both when an 
attribute of an element does not exist and when it equals X. 
Specifically, I would like the contents of data-field tag 555 
to appear if this data-field does not have any "ind1" 
attribute, or if its ind1 equals 8.

Use the predicate [not(@ind1) or @ind1=8].

Or if you want to be clever about it, you can write [not(@ind1!=8)]

Michael Kay
http://www.saxonica.com/


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>