[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
Hi,
A slight qualification (really for the archive): On 8/16/2012 5:35 AM, it was written: in a template for<media> just pull in the value of<image-size> like this: There is an edge case in which this will give an error (in XSLT 2.0) unless you control your data to prevent more than one 'image-size' element appearing somewhere inside the parent of 'media': if more than one is the first 'image-size' child of their respective parents. This is due to the problematic semantics of "//node" (which expands to "/descendant-or-self::node()/child::node") when used with a positional predicate such as [1]: ..//image-size[1] expands to parent::node()/descendant-or-self::node()/child::image-size[position() = 1] Under 1.0, normalize-space() will take the first element in a node-set argument in any case (no error), so you don't even need the [1]. 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 ... Cheers, Wendell ====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|