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

Re: moving an element and then converting it to an at

Subject: Re: moving an element and then converting it to an attribute
From: Michael Müller-Hillebrand <mmh@xxxxxxxxx>
Date: Fri, 17 Aug 2012 21:11:03 +0200
Re:  moving an element and then converting it to an  at
> ..//image-size[1]
>
> expands to
>
> parent::node()/descendant-or-self::node()/child::image-size[position() = 1]

which might result in a sequence of more than one element.

> But it might be good to learn
>
> normalize-space(../descendant::image-size[1])
>
> in case you're ever running under XSLT 2.0 ...
>
> ... at least as long as you agree that a little paranoia never hurt ...

Wendell,

I dont see this as paranoia, because such stuff happens! Do you agree that
another option to force the resulting sequence to have only one element would
be

normalize-space((..//image-size)[1])

But I agree that the use of descendant:: is much clearer, especially to people
who (have to) read this bit of code later.

- Michael

--
DOCUFY GmbH
Michael M|ller-Hillebrand | Senior Consultant
www.docufy.de

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.