xsl-list
[Top] [All Lists]

Re: [xsl] tokenize function behaviour

2010-09-03 08:42:02
ok, many thanks, sorry for bothering.


Il giorno ven, 03/09/2010 alle 15.35 +0200, Martin Honnen ha scritto:
Bartolomeo Nicolotti wrote:

could you please confirm that

count(tokenize( @Attribute,';'))

returns:

0 if Attribute=""
2 if Attribute=";"

Looking at http://www.w3.org/TR/xpath-functions/#func-tokenize it 
clearly says

"If $input is the empty sequence, or if $input is the zero-length 
string, the result is the empty sequence."

so yes, count(tokenize('', ';')) is 0.

And it also says

"If a separator occurs at the start of the $input string, the result 
sequence will start with a zero-length string. Zero-length strings will 
also occur in the result sequence if a separator occurs at the end of 
the $input string, or if two adjacent substrings match the supplied 
$pattern."

so you get 2 for count(tokenize(';', ';'))

-- 
____________________________________________________________
Bartolomeo Nicolotti - Reparto Sviluppo - SIAP s.r.l.
Via Sant'Albano, 13 - 12049 Trinità (CN) Italy
Tel. (+39) 0172 652511 - Fax (+39) 0172 652519
E-mail: bnicolotti(_at_)siapcn(_dot_)it - URL: www.siapcn.it
Codice Fiscale, Partita IVA, Iscr. Reg. Imprese di Cuneo: 01871320048
Capitale Sociale: € 99.000,00 i.v. - R.E.A. CN 141311
____________________________________________________________

Le informazioni contenute nella presente comunicazione e i relativi
allegati possono essere riservate e sono, comunque, destinate
esclusivamente alle persone o alla Società sopraindicati. La
comunicazione, diffusione, distribuzione e/o copiatura del documento
trasmesso nonché qualsiasi forma di trattamento dei dati ivi contenuti
da parte di qualsiasi soggetto diverso dal destinatario è proibita, sia
ai sensi dell'art. 616 c.p., che ai sensi del D. Lgs. n. 196/2003, ed in
ogni caso espressamente inibita. Se avete ricevuto questo messaggio per
errore, vi preghiamo di distruggerlo e di informarci immediatamente per
telefono allo 0172/652511 o inviando un messaggio all'indirizzo:
info(_at_)siapcn(_dot_)it
____________________________________________________________

This electronic mail transmission, including any accompanying documents
or attachments, may contain information that is confidential,
privileged, proprietary, or otherwise legally exempt from disclosure and
it's intended solely for the addressee(s).  Access to this Internet
electronic mail message by anyone else is unauthorized.  If you are not
the intended recipient, any disclosure, copying, distribution or any
action taken or omitted to be taken in reliance on it is prohibited and
may be unlawful. If you have received this electronic mail erroneously,
we ask you to to destroy it and let us know immediately by phone
at 0172/652511 or by sending an e-mail at info(_at_)siapcn(_dot_)it 
____________________________________________________________




--~------------------------------------------------------------------
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>