xsl-list
[Top] [All Lists]

Re: [xsl] double escaping problem [resolved]

2007-11-12 13:45:03
My apologies -- it seems when I add disable-output-escaping="yes" on the <xsl:value-of/> element, my problem goes away. So unless that's an egregiously improper use of DOE, I think my problem is solved.

-peter keane

On Mon, 12 Nov 2007, pkeane wrote:

My apologies is this is repeat material, but I was unable to find the answer by searching the archives.

I am building a web application based on REST-based web services. It is digital asset repository/management tool and all of the "data" in the system lives in a relational database but is exposed to the rest of the application by way of XML documents accessed over http. The entire user interface is constructed using xslt which consumes and "mashes up" these services to present html pages to the user. There is a site-wide XSLT stylesheet and a sitewide "layout" xml file. Each request is mapped to a small script which invokes an XSLT processor, and specifies the page-specific stylesheet to use (this page-specific stylesheet will "include" the site-wide stylesheet). The "source" is the site-wide layout.xml and all of the rest of the data comes from service documents which are grabbed by way of the xslt document() function. The controller (the small script that the request was mapped to) passes parameters to the processor specifying URLs for the data documents.

So...a request for "http://example.com/collections"; will use the collections.xsl stylesheet which will in turn invokes document(http://example.com/xml/collections) which returns an xml document listing the collections.

Unfortunately, I have a double escaping problem I cannot seem to get rid of, short of using translate(@my_text,'amp;','') when an ampersand appears in any of the text from the service document. The service documents, of course, have already had ampersands escaped and my process escapes them again, so I get "Art &amp; Art History Collection" being presented to the user (view source of the html shows "Art &amp;amp; Art History).

Disable-output-escaping makes no difference (I believe because output is set to be xml -- I am using xhtml strict doctype).

Any help would be greatly appreciated.

-Peter Keane
daseproject.org



--~------------------------------------------------------------------
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>
--~--


--~------------------------------------------------------------------
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>
--~--