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

RE: normalize-space and sequence

Subject: RE: normalize-space and sequence
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 26 Sep 2007 00:26:34 +0100
RE:  normalize-space and sequence
>   I am having a very simple issue here. I'd like to be able to apply
> normalize-space() even if I am dealing with a sequence of 
> string. If I do call normalize-space, the transformation 
> implicitly convert my sequence of string into string (saxon 8.9).

If the stylesheet specifies version="1.0", then normalize-space() will
process the first string in the sequence and ignore the others. If it
specifies version="2.0", then you will get a type error.

>   What's is this function that convert sequence of strings 
> into string ?

You can apply normalize-space to every string in a sequence (returning a
sequence of normalized strings) in the usual way: for $i in $seq return
normalize-space($i). If you want to combine a sequence of strings into a
single string, use string-join().
> 
>   As a side note, there is no way to globally say 'all my xml 
> attribute/elements should have normalize space'.

Yes there is: you can declare their types in a schema to derive from
xs:token, and use schema-aware XSLT processing.

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

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.