Re: [xslt] one more time...but a solution -> single quot in param




Almost.  If your literal contains both single and double
quotes:

   Shakespeare's "Twelfth Night"

then you need to bypass the standard mechanism for
passing parameters used by xsltproc.  Version 1.0.4
has code to handle this case.  In variables.c
look at xsltQuoteUserParams and xsltQuoteOneUserParam.

You will have to do more of the work yourself:

    context = xsltNewTransformContext(...);
    res = xsltApplyStylesheetUser(...);

as well as get the encoding and save the result to
a buffer.

Tom Moog
Polhode, Inc.

On Fri, 5 Oct 2001, Daniel Allen wrote:

> Okay, it seems we are cornered by this seemingly narly
> little problem.  If you use double quotes on the
> outside, you can use bash (or shell) variables and you
> can escape characters with a \  However, if you do
> 
> quot="'"
> 
> --param foo "'He${quot}s up to something'"
> 
> Bash says, cool cool!, but the processor still views
> it as
> 
> 'He's up to something'
> ---^
> 
> So, here is my quick and dirty...use the double quotes
> on the outside, then, replace all double quotes with
> \" and all single quotes with \` (tic) and then when
> you get into the xslt stylesheet, do a translate ` for
> ' and you are set!!!
> 
> Dan
> 
> 
> __________________________________________________
> Do You Yahoo!?
> NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
> http://geocities.yahoo.com/ps/info1
> 
> _______________________________________________
> xslt mailing list
> xslt@gnome.org
> http://mail.gnome.org/mailman/listinfo/xslt
> 





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]