Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

inserting special characters

Status
Not open for further replies.

scotth4v

Programmer
Apr 17, 2001
103
US
Hi Gang,

How would I insert a non-breaking space into an XSL stylesheet? &quot;&nbsp;&quot; I know the <,>,&, etc. must use the &lt; etc, but what about other HTML special chars?

Also, since XSl views HTML as XML and must have all attrributes double quoted... how would I add a &quot;nowrap&quot; attrib to a table cell generated by an XSL stylesheet?

Thanks!

-Scott
 
All special chars can be inserted as entity references. The syntax is: &#<hex of char>;

ie: nbsp is &#160; ( I think ;o)

To do things like nowrap on a table cell, put: nowrap=&quot;&quot; another situation is 'selected' on a drop down input tag.

Good Luck
--
Scott


 
Awesome, thanks... now I just need to find a table listing all of the hex values and I'll be a happy camper... I know I have one somewhere... hahah
 
the nbsp scenario is a nightmare using xsl (see other threads in here regarding white-space etc.). using the above format i think you have to encompass within <PRE> tags if you want to, say, format an empty table cell to display in 3d as the rest of the table is (see the invoice example from microsoft) - the problem here is that in the <PRE> tags means that the space is then at a [larger] fixed font size?
Mark Saunders :)
 
Well, I know it's a cluge, and I hate to add server requests, but I guess a 1 pixel gif would do it as well. I'm building a bucktracker with pure xsl/servlets, and I'm used to doing it all in asp/jsp, so it's a change in mindset I need to make and learn to work around the constraints of the two.
 
Hi all,

I have <manufacturer>johnson&johnson<manufacturer>
i have tried giving<manufacturer>johnson&johnson<manufacturer>
but the value gets truncated and gives me only &quot;johnson&quot;
can anybody please help me....
 
the browser is getting confused over the ampersand - try using
Code:
&amp;
- the same goes for quotes whereby you must use
Code:
&quot;
Mark Saunders :)
 
Hi all. I am working on something that uses Java and XML. I have a customer's name &quot;Andy & Sons Company&quot; in my XML file. Then, I use Java to read from that XML file and put the data in a vector. I noticed that the character '&' is treated as an element on its own, thus messing up my GUI display (setting text to TextFields) when I select that customer record value from a list. Can someone show me how I can solve this problem? I dont want the special character to be treated as an element on its own.

TQ
 
The only satisfactory solution I've found has been to avoid them completely, including using substitute characters (you can use entity references -- list at ) and then, if needed substitute with a pre-processor. I need them sometimes because they're useful in dynamic processing.

I'd certainly like to learn a better way if anyone knows of one.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top