Hi, Le lundi 04 septembre 2006 ā 14:06 +0200, bryan rasmussen a écrit : > >(3) recursion over the items being summed, > >.... None of these can conveniently be used in an XPath > > (as distinct from XSLT) context. > > I recently had to do something similar to this for a problem defined as: > > every line of text up to and including X lines of text must have no > more than Y characters in the line. > > (my recollection of the problem is perhaps a little fuzzy, it was > several months ago) > > For example something like the following: > > <sch:assert test="string-length(substring-before(concat(.,'
'),'
'))<5">1: > Every line of the <sch:name/> text node should be no more than 5 > characters long</sch:assert> > <sch:assert test="string-length(substring-before(substring-after(concat(.,'
'),'
'),'
'))<5">2: > Every line of the <sch:name/> text node should be no more than 5 > characters long</sch:assert> > <sch:assert test="string-length(substring-before(substring-after(substring-after(concat(.,'
'),'
'),'
'),'
')) > < 5">3: Every line of the <sch:name/> text node should be no more > than 5 characters long</sch:assert> > > and so forth > > The assertions are only called in cases where the string length is incorrect. > > As such the rather impossible to write or maintain assertions can be > generate without need to loop or recurse over an input. Long XPath expressions like these can also be made more readable (but still hackier) by using good old entities :) ... Eric -- GPG-PGP: 2A528005 Le premier annuaire des apiculteurs 100% XML! http://apiculteurs.info/ ------------------------------------------------------------------------ Eric van der Vlist http://xmlfr.org http://dyomedea.com (ISO) RELAX NG ISBN:0-596-00421-4 http://oreilly.com/catalog/relax (W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema ------------------------------------------------------------------------
Ceci est une partie de message=?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?=