xsl-list
[Top] [All Lists]

Re: [xsl] Confused about entities

2006-03-14 08:07:09
On 3/14/06, Gary Stewart <the(_dot_)stewarg(_at_)gmail(_dot_)com> wrote:
On 14/03/06, andrew welch <andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com> 
wrote:

If you are outtputting as XML where are the &nbsp;'s coming from?

Are you writing them out manually in the stylesheet - as is in &amp;nbsp;?

Nope but thanks for the clue. The *input* is double escaped (I must
stop trusting a browser when viewing the output). That is I've
actually got &amp;nbsp; as the input which explains why there is no
conversion going on. Later on in a different transform I do a
saxon:parse which then obviously can't find the reference to a &nbsp;
and therefore throws an exception.

Yes - a bit of double escaping had to be involved somewhere :)

I'll have a go at it now. The most obvious way might just be to
expression match the characters and change them or to attempt to parse
the input and change it. I'll experiment for now unless anyone has
some good ideas.

yes, good idea, have a template that matches text() and do a replace()
or xsl:analyse-string  on the string "&nbsp;"

cheers
andrew

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--