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

Re: JavaScript and  

Subject: Re: JavaScript and  
From: Mike Brown <mike@xxxxxxxx>
Date: Fri, 11 Aug 2000 10:38:34 -0600 (MDT)
javascript xml amp
Shelly Nippard wrote:
> 1) i'm using eXcelon stylus to write xsl and the processor does not
> recognize either of the following for a non-breaking space: a) &amp;nbsp; OR
> b) &nbsp;

This is a FAQ that is in the FAQ. I don't mind typing it again, though.

&nbsp; is in both HTML and XML an entity reference. In HTML this entity is
by definition a representation of the numeric character reference
"&#160;". This is information is in the HTML specs. HTML and XML use the
same document character set (ISO/IEC 10646-1; 'Unicode', more or less), so
character number 160 is the same in both worlds.

The only entities predefined in XML are &amp; &lt; &gt; &quot; &apos; for
& < > " ', respectively. XSL is XML. So if you want a non-breaking space
character in your XSL document, you have several XML mechanisms for
representing it.

Without defining a new entity, your options are to use the numeric
character reference &#160; or &#xA0; or you can type or copy/paste the
literal character from somewhere (I typically use Character Map or Bjondi
Character Agent in Win95/98/NT/2000, or on WinNT, you can hold down Alt
and type 0160 on the keypad). You also have these options in HTML.

If you want to define an entity, add an entity declaration to the internal
DTD subset of the document that contains the &nbsp;, like this:

<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#160;"> ]>

or import a file full of such declarations:

<!DOCTYPE xsl:stylesheet SYSTEM "xml-ISOents.txt">

You can get such a file at
http://www.oasis-open.org/cover/xml-ISOents.txt

Once you have put the character into the XSL document, it will go into the
stylesheet tree and result tree as the character you wanted, not as an
entity reference or numeric character reference. It will get changed back
into a reference upon output, depending on what output method you specify
and your XSLT processor's behavioral conventions.

> 2) how do you incorporate a JavaScript tag in xsl?

Also a FAQ.

http://www.dpawson.co.uk/
I'm having trouble accessing it right now, though.

See part C.4 of the XHTML 1.0 Recommendation at
http://www.w3.org/TR/xhtml1/

   - Mike
____________________________________________________________________
Mike J. Brown, software engineer at         My XML/XSL resources:
webb.net in Denver, Colorado, USA           http://www.skew.org/xml/


 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.