W3C home > Mailing lists > Public > public-xml-processing-model-wg@w3.org > April 2007

Re: Semantics of p:string-replace

From: Innovimax SARL <innovimax@gmail.com>
Date: Sat, 28 Apr 2007 07:32:49 +0200
Message-ID: <546c6c1c0704272232h3424a6c7rf0ed5ec95973d8a2@mail.gmail.com>
To: "Henry S. Thompson" <ht@inf.ed.ac.uk>
Cc: "Norman Walsh" <ndw@nwalsh.com>, public-xml-processing-model-wg@w3.org
Ok
here is another attempt

Since we lack conditionnal in xpath, I propose to add a custom XProc
function "p:if(conditional;then;else)"


In that case, we would do that this way :

<p:string-replace>
   <p:option name="match" value="p/node()"/>
   <p:option name="replace" value="p:if(position()=1, concat('[',..,']'),
'')"/>
</p:string-replace>

Mohamed

On 4/27/07, Innovimax SARL <innovimax@gmail.com> wrote:
>
> But it doesn't work
>
> You get this instead
>
> <div>
>      <p class="value1 value2">[
>        Some
>        linked
>        text.
>      ]<a href="http://example.com/">linked</a>
>      text.
>    </p>
> </div>
>
> On 4/27/07, Innovimax SARL <innovimax@gmail.com> wrote:
> > Very nice one !!
> >
> >
> > On 4/26/07, Henry S. Thompson <ht@inf.ed.ac.uk> wrote:
> > >
> > > -----BEGIN PGP SIGNED MESSAGE-----
> > > Hash: SHA1
> > >
> > > ht writes:
> > >
> > > > Norman Walsh writes:
> > >
> > > >> I don't think there's any way to produce the result:
> > > >>
> > > >>   <div>
> > > >>     <p class="value1 value2">[
> > > >>       Some
> > > >>       linked
> > > >>       text.
> > > >>     ]</p>
> > > >>   </div>
> > > >
> > > > Agreed.
> > >
> > > Oops -- what about
> > >
> > >    <p:string-replace>
> > >      <p:option name="match" value="p/node()[1]"/>
> > >      <p:option name="replace" value="concat('[',..,']')"/>
> > >    </p:string-replace>
> > >
> > > ht
> > > - --
> > > Henry S. Thompson, HCRC Language Technology Group, University of
> Edinburgh
> > >                      Half-time member of W3C Team
> > >     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131
> 650-4440
> > >             Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
> > >                    URL: http://www.ltg.ed.ac.uk/~ht/
> > > [mail really from me _always_ has this .sig -- mail without it is
> forged
> > spam]
> > > -----BEGIN PGP SIGNATURE-----
> > > Version: GnuPG v1.2.6 (GNU/Linux)
> > >
> > >
> > iD8DBQFGMR5wkjnJixAXWBoRAhu0AJ4iXx89ztVQqyC4e+9KUE9S+SsWxQCfZocC
> > > PqkMxIWfntkJLpvWsGOR8hs=
> > > =34Cq
> > > -----END PGP SIGNATURE-----
> > >
> > >
> >
> >
> >
> > --
> > Innovimax SARL
> > Consulting, Training & XML Development
> > 9, impasse des Orteaux
> > 75020 Paris
> > Tel : +33 8 72 475787
> > Fax : +33 1 4356 1746
> >  http://www.innovimax.fr
> > RCS Paris 488.018.631
> > SARL au capital de 10.000 
>
>
> --
> Innovimax SARL
> Consulting, Training & XML Development
> 9, impasse des Orteaux
> 75020 Paris
> Tel : +33 8 72 475787
> Fax : +33 1 4356 1746
> http://www.innovimax.fr
> RCS Paris 488.018.631
> SARL au capital de 10.000 
>



-- 
Innovimax SARL
Consulting, Training & XML Development
9, impasse des Orteaux
75020 Paris
Tel : +33 8 72 475787
Fax : +33 1 4356 1746
http://www.innovimax.fr
RCS Paris 488.018.631
SARL au capital de 10.000 
Received on Saturday, 28 April 2007 05:32:52 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:21:50 GMT