Next in thread → Next in month →

Re: [docbook-apps] character references in parameter values

From
Colin Paul Adams <>
Date
2007-11-03T19:51:39+00:00
ID
Thread
Re: [docbook-apps] character references in parameter values
>>>>> "Bob" == Bob Stayton <> writes:

    Bob> I have just noticed that when I pass in a text string as a
    Bob> parameter on the command line, any character references are
    Bob> escaped. For example:

    Bob>   &#x2021;

    Bob> becomes

    Bob>   &amp;#x2021;

    Bob> In my output, I get the literal string "&#x2021;" instead of
    Bob> my special character.

    Bob> This seems to be the case with both xsltproc and saxon.  

And Gestalt too.

    Bob> If the parameter is defined inside the stylesheet, then the
    Bob> ampersand is *not* escaped and the character is properly
    Bob> interpreted.  This seems inconsistent, but maybe I'm missing
    Bob> something.

Yes, I think you are.

If the parameter is defined inside the stylesheet, then it is part of
an XML document, and so is read by the XML parser as a character
reference.

If the value is given on the command line as a string, then it is just
text. No XML parser will be invoked.
-- 
Colin Adams
Preston Lancashire
Next in thread → Next in month →