- From: Innovimax W3C <innovimax+w3c@gmail.com>
- Date: Sun, 5 Feb 2012 17:30:13 +0100
- To: Alex Milowski <alex@milowski.com>
- Cc: XProc WG <public-xml-processing-model-wg@w3.org>
I can't see how p:try/p:catch would make it less complex... Mohamed On Wed, Feb 1, 2012 at 9:06 PM, Alex Milowski <alex@milowski.com> wrote: > Hmm... maybe. I had thought of more of a try/catch operation that > would catch type errors. > > Using p:choose a lot can make simple pipelines very complicated. > > > On Wed, Feb 1, 2012 at 6:32 AM, Innovimax W3C <innovimax+w3c@gmail.com> wrote: >> Alex, >> >> Are you asking for this >> >> <?xml version="1.0" encoding="UTF-8"?> >> <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" >> exclude-inline-prefixes="c xs" >> xmlns:c="http://www.w3.org/ns/xproc-step" >> xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" >> xpath-version="2.0"> >> <p:output port="result"/> >> <p:group> >> <p:choose> >> <p:variable name="a" select="'2012-02-30'"/> >> <p:when test="$a castable as xs:date"> >> <p:identity> >> <p:input port="source"> >> <p:inline> >> <the-variable-is-castable-as-date/> >> </p:inline> >> </p:input> >> </p:identity> >> </p:when> >> <p:otherwise> >> <p:identity> >> <p:input port="source"> >> <p:inline> >> <the-variable-is-NOT-castable-as-date/> >> </p:inline> >> </p:input> >> </p:identity> >> </p:otherwise> >> </p:choose> >> </p:group> >> </p:declare-step> >> >> Mohamed >> On Tue, Jan 31, 2012 at 3:50 PM, Alex Milowski <alex@milowski.com> wrote: >>> Also, as I'm binding certain typed values to options (e.g. pulling a >>> start time off the query parameters), I'd really like an easy way to >>> say: >>> >>> "This option is typed as xs:dateTime. If the value does not cast >>> properly, run this other part of the pipeline." >>> >>> One simple way we could accomplish this is to allow type errors within >>> a certain portion of the pipeline to be caught and processed somehow. >>> >>> -- >>> --Alex Milowski >>> "The excellence of grammar as a guide is proportional to the paucity of the >>> inflexions, i.e. to the degree of analysis effected by the language >>> considered." >>> >>> Bertrand Russell in a footnote of Principles of Mathematics >>> >>> >> >> >> >> -- >> Innovimax SARL >> Consulting, Training & XML Development >> 9, impasse des Orteaux >> 75020 Paris >> Tel : +33 9 52 475787 >> Fax : +33 1 4356 1746 >> http://www.innovimax.fr >> RCS Paris 488.018.631 >> SARL au capital de 10.000 € > > > > -- > --Alex Milowski > "The excellence of grammar as a guide is proportional to the paucity of the > inflexions, i.e. to the degree of analysis effected by the language > considered." > > Bertrand Russell in a footnote of Principles of Mathematics > -- Innovimax SARL Consulting, Training & XML Development 9, impasse des Orteaux 75020 Paris Tel : +33 9 52 475787 Fax : +33 1 4356 1746 http://www.innovimax.fr RCS Paris 488.018.631 SARL au capital de 10.000 €
Received on Sunday, 5 February 2012 16:30:51 UTC