W3C home > Mailing lists > Public > xproc-dev@w3.org > July 2009

Re: A good use for p:string-replace?

From: James Sulak <jsulak@gmail.com>
Date: Fri, 3 Jul 2009 09:11:56 -0500
Message-ID: <7cb78b3b0907030711x9f84ed0l79957cdb41e3887@mail.gmail.com>
To: "Costello, Roger L." <costello@mitre.org>
Cc: "xproc-dev@w3.org" <xproc-dev@w3.org>
Hi Roger,

I've used it for a few things in an upconversion pipeline:

<!-- Remove brackets that surround "deleted" text in StickenText tags -->
<p:string-replace
match="text()[following-sibling::node()[1][self::StrickenText]]"
replace="replace(., '\[$', '')"/>
<p:string-replace
match="text()[preceding-sibling::node()[1][self::StrickenText]]"
replace="replace(., '^\]', '')"/>

<!-- Replace AutoNum elements with actual numbers -->
p:string-replace match="AutoNum" replace="count(preceding::AutoNum) + 1"/>

<!-- Replace SoftSp elements with actual spaces -->
<p:string-replace match="SoftSp" replace="' '"/>

Hope this helps,

-James


On Fri, Jul 3, 2009 at 8:19 AM, Costello, Roger L.<costello@mitre.org> wrote:
>
> Hi Folks,
>
>   Has anyone found a good use for p:string-replace?
>
>   If so, would you give an example please?
>
> /Roger
>
Received on Friday, 3 July 2009 14:12:36 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 3 July 2009 14:12:36 GMT