Warming up for 3.5.4 [ChangeLog-changes]
Frans Englich
englich at kde.org
Thu Jun 22 15:41:57 BST 2006
On Thursday 22 June 2006 14:18, Philip Rodrigues wrote:
> Frans Englich wrote:
> >> You can now. For example:
> >> <feature rev="123456">Focus follows mind. <rev no="123457"/> </feature>
> >
> > To me that seems like an unfortunate design. I would specify the rev
> > attribute to be of a list type containing xs:integer(or
> > xs:positiveInteger, would be better), such that one could write:
> >
> > <feature rev="123456 123567 5423535"/>
>
> Yes, the design is fairly bad. I couldn't see a way to get XSLT to treat
> the numbers as a list (rather than just a string with spaces), so I can
> loop over it, though. Do you know of a way to do it?
With libxslt, you can use EXSL'Ts tokenize split() function, which gives you a
node set that you can apply templates on, loop with for-each and so on.
http://www.exslt.org/str/functions/split/index.html
I really should redirect focus on XSL-T 2.0 to get it finished in Patternist,
so we can use it. In XSL-T 2.0, some alternatives would be:
* tokenize(@rev, ' ')
Evaluates to a list of strings.
* for $i in tokenize(@rev, ' ') return xs:positiveInteger($i)
Evaluates to a list of integers.
I gladly answer XSL-T-programming questions, perhaps more suitable on
kde-devel though.
Cheers,
Frans
More information about the kde-core-devel
mailing list