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

Re: Variables and HTML

Subject: Re: Variables and HTML
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 11 Mar 2005 10:18:54 GMT
variables in html
I wrote

   In addition to Michael's reasons, there is also the fact that 2.0 has
   character maps that can be used for many of the things that d-o-e is
   used for in a slightly less disruptive way architecturally.

   David

To expand on that, one of the problems with d-o-e is that you can go
<xsl:value-of select="'&lt;br&gt;'"/>
<xsl:value-of disable-output-escaping="yes" select="'&lt;br&gt;'"/>

and the model is that that puts something  into the result tree which
when linearised at the end of the process produces

&lt;br&gt;<br>

The trouble is that, as specified, there isn't really anything that can
go into result tree text nodes that can have that effect, so systems
that support d-o-e have to have some private internal annotations to
record those bits of the tree where d-o-e is in effect.

In 2.0 you can always replace this by

<xsl:value-of select="'&lt;br&gt;'"/>
<xsl:value-of select="translate('&lt;br&gt;','&lt;&gt;&amp;','&#xE001;&#xE002;&#xE003;'"/>

Together with a character mao that maps back:

<xsl:output-character character="&#xE001; string="&lt;"/>
<xsl:output-character character="&#xE002; string="&gt;"/>
<xsl:output-character character="&#xE003; string="&amp;"/>

This works the same way except that now the information is stored in the
result tree using a mechanism that is actually allowed by the
specification of the datamodel (just three otherwise unused characters).


Of course the other problems with d-o-e remain, that this still only
works if serialisation is tightly controlled by the XSLT engine and that
in nine times out of ten it is only being used by mistake, when the
stylesheet could have gone

<br/>

and used an element node directly.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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.