Subject: Re: JavaScript and &nbsp; From: Mike Brown <mike@xxxxxxxx> Date: Fri, 11 Aug 2000 10:38:34 -0600 (MDT) |
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) &nbsp; OR > b) This is a FAQ that is in the FAQ. I don't mind typing it again, though. is in both HTML and XML an entity reference. In HTML this entity is by definition a representation of the numeric character reference " ". 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 & < > " ' 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   or   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 , like this: <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]> 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
JavaScript and &nbsp;, Shelly Nippard | Thread | RE: JavaScript and &nbsp;, Tamsin |
Failed saxon:output, Michael Labhard | Date | Selecting case insensitively, Doug Howell |
Month |