xsl-list
[Top] [All Lists]

Re: [xsl] Select with multiple conditions?

2021-12-08 10:58:11
Michele, You are not alone...

Sometimes (very rarely) I try to use a single | for the concatenation
operator :)

And sometimes even mistake ! for |

Probably we need an "XPath font" ?

Thanks,
Dimitre

On Wed, Dec 8, 2021 at 6:53 AM Michele R Combs mrrothen(_at_)syr(_dot_)edu <
xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:

All three of these constructions appear to be valid (this is xsl 1.0,
sorry for being antiquated!).  Will there be differences in the output?  If
not, is one option “better” than the others, and if so why?  I’m guessing
that there are no differences in output, and that option 3 is better
because more concise.  Am I right?





“or” statements in the select condition:



<xsl:for-each select="child::*[@level = 'collection']  | child::*[@level =
'recordgrp']  | child::*[@level = 'series'] | child::*[@level =
'subseries']">



“or” statements inside the node description [ ]



<xsl:for-each select="child::*[@level = 'collection' | @level =
'recordgrp' | @level = 'series' | @level = 'subseries']">



“or” statements inside the attribute match



<xsl:for-each select="child::*[@level = 'collection' | 'recordgrp' |
'series'  | 'subseries']">





Michele

*+++++++++*

*Michele Combs* | Lead Archivist

Special Collections Research Center
*Visit our blog!* library-blog.syr.edu/scrc/
Syracuse University Libraries
222 Waverly Ave
Syracuse, New York 13244

*t* 315.443-2081 | *e* mrrothen(_at_)syr(_dot_)edu | *w* scrc.syr.edu

*SYRACUSE UNIVERSITY*
syr.edu


XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/782854> (by
email <>)



-- 
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
Never fight an inanimate object
-------------------------------------
To avoid situations in which you might make mistakes may be the
biggest mistake of all
------------------------------------
Quality means doing it right when no one is looking.
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play
-------------------------------------
To achieve the impossible dream, try going to sleep.
-------------------------------------
Facts do not cease to exist because they are ignored.
-------------------------------------
Typing monkeys will write all Shakespeare's works in 200yrs.Will they write
all patents, too? :)
-------------------------------------
Sanity is madness put to good use.
-------------------------------------
I finally figured out the only reason to be alive is to enjoy it.
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--
<Prev in Thread] Current Thread [Next in Thread>