[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Avoiding disable-output-escaping

Subject: RE: Avoiding disable-output-escaping
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Fri, 27 Apr 2001 11:23:39 +0100
jsp from xml
> 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" />

Just write the following in your stylesheet, making sure the namespace is
declared:

<sw:hpath startscan="0" endscan="100" startpath="2" />

>
> How can I get such an expression without disable-output-escaping?

Why do you think you need disable-output-escaping for this?

> Additionally I dont want to describe such a tag in the XML
> file. Instead I
> have to write it somewhere in the XSL.

Good, that's what I suggested.
>
> 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

No need to do that in Java, you can do it in XSLT. Look for the document()
function.

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

Ah, you've got a problem there. The CDATA section is telling the XML parser
to treat the stuff inside it as text rather than as XML, so you lose all the
benefits of using XML markup. Why are you doing this?

Mike Kay
Software AG


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.