This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Avoiding disable-output-escaping
- To: "Xsl-List (E-Mail)" <xsl-list at lists dot mulberrytech dot com>
- Subject: [xsl] Avoiding disable-output-escaping
- From: Sebastian Schirmer <schirmer at sitewaerts dot de>
- Date: Fri, 27 Apr 2001 11:04:16 +0200
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hello!
I try to generate JSP from XML. In these JSPīs, I need output tags like this
one:
<sw:hpath startscan="0" endscan="100" startpath="2" />
How can I get such an expression without disable-output-escaping?
Additionally I dont want to describe such a tag in the XML file. Instead I
have to write it somewhere in the XSL.
At the moment I use the following to avoid horribly escaped expressions to
include hardcoded parts of markup:
I defined a namespace
xmlns:ext="http://de.sitewaerts.futuna.test.XSLIncluder" that references a
java class. This class has a method named getXmlInclude(key) that looks in
another XML File, searches the passed key and returns the value for that
key, for example the following in the XSL
<xsl:value-of select="ext:getXmlInclude('JSPHeader')"
disable-output-escaping="yes"/>
outputs the following
<head>
<sw:base target="_UNTEN" />
<title><sw:cv key="name" /></title>
<sw:meta />
<link rel="stylesheet" type="text/css"
href="styles/content.css"/>
</head>
from a lookup in an external XML file that looks like this:
<env-entry>
<env-entry-name>JSPHeader</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value><![CDATA[
<head>
<sw:base target="_UNTEN" />
<title><sw:cv key="name" /></title>
<sw:meta />
<link rel="stylesheet" type="text/css"
href="styles/content.css"/>
</head>
]]></env-entry-value>
</env-entry>
Sebastian Schirmer
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list