An extension function (escape-URL()?) could be a solution but I think
Sablotron should be conforming before starting with extensions. xsl:eval
seems to be somewhat less proprietary but again, its implementation priority
is lower than that of required features.

Currently, I see the postprocessing or preprocessing (concerned strings are
already escaped in input XML) as the only way.

Petr

Honza Pazdziora wrote:

> Hello,
>
> I use Sablotron via AxKit and XML::Sablotron. I try to transform input
>
>         <people>
>                 <person><id>243</id><name>Peter Jones</name></person>
>                 <person><id>244</id><name>Carol Smith</name></person>
>         </people>
> to
>         <UL>
>         <LI><A HREF="/homepage/?id=243">Peter Jones</A>
>         <LI><A HREF="/homepage/?id=244">Carol Smith</A>
>         </UL>
>
> This is easy in easy cases.
>
> However, the question is: what is the recommended way of escaping
> the parameters in the URL? Here they are numbers but as they may
> contain anything in other situations, a way of changing
>
>         <id>" val "</id>
> to
>         "?id=%22+val+%22"
>
> would be needed. Currently (for lack of better idea) I do this by
> postprocessing the output and doing this kind of transformation in
> XPathScript but I wonder if some way of doing this directly in
> Sablotron exists or is planned.
>
> One way I can see is xsl:eval and call either some C or (with
> XML::Sablotron) perl function or evaluation code a la JVS or ASP/VB
> approaches, another way could be using namespaces -- but I honestly
> admit that I don't know how standard compliant these would be.
>
> Any comments would be appreciated,
>
> --
> ------------------------------------------------------------------------
>  Honza Pazdziora | [EMAIL PROTECTED] | http://www.fi.muni.cz/~adelton/
>  .project: Perl, mod_perl, DBI, Oracle, auth. WWW servers, XML/XSL, ...
> ------------------------------------------------------------------------

--
Petr Cimprich
Ginger Alliance Ltd.
www.gingerall.com


Reply via email to