[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Escaping Characters in replace()

Subject: Re: Escaping Characters in replace()
From: Nathan Tallman <ntallman@xxxxxxxxx>
Date: Tue, 15 Oct 2013 15:31:21 -0400
Re:  Escaping Characters in replace()
Thank you, David and Ivan. It did, of course, work... I just had more
problems than I thought. The code you helped with, works in situations
like:

    <unittitle>"The Atomic Bomb Foreshadowed: 1700 Years Ago".
1947.</unittitle>

However, I also have to account for situations like:
    <unittitle>
        <title render="doublequote">The Atomic Bomb Foreshadowed: 1700
Years Ago</title>. 1947.</unitdate>
    </unittitle>

There are separate instructions that insert " before the title/text()
and ." after title/text(), which results in:
    "The Atomic Bomb Foreshadowed: 1700 Years Ago.". 1947.

In this scenario, how can I get rid of the extraneous period? Should I
test for a unittitle/title that is immediately followed by a period?
If so, how would I do that? Testing on unittitle/title won't let me
change anything outside the node, like the extra period.

Many, many thanks for your wisdom.

Nathan

On Tue, Oct 15, 2013 at 1:49 PM, Ivan Shmakov <oneingray@xxxxxxxxx> wrote:
>>>>>> Ivan Shmakov <oneingray@xxxxxxxxx> writes:
>>>>>> Nathan Tallman <ntallman@xxxxxxxxx> writes:
>
> [b&]
>
>  >> Also, I seem to be able to delete the backslash in front of the
>  >> period in the second argument without causing problems...  Why is
>  >> that?)
>
>  > The probable cause is that the source text doesnbt contain any
>  > sequences of the form b(any character other than b.bb)b("b) in
the
>  > context replace () is applied to.  Otherwise, these would also be
>  > replaced with b(".b), as in:
>
>  > Source: <unittitle>"Mary had a little lamb"</unittitle>
>
>  > Result: <unittitle>"Mary had a little lam."</unittitle>
>
>         The above should (obviously) have been the other way around b
>         b("b)b(any character other than b.bb), with the example
being, say:
>
>    Source: <unittitle>"Mary had a little lamb" </unittitle>
>    Result: <unittitle>"Mary had a little lamb."</unittitle>
>
>         My guess is that such bsourceb elementbs text is indeed a bit
>         unlikely to occur.
>
> --
> FSF associate member #7257

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.