Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

  in text Node

 
Abhijit Das
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to place the text node as   in a element as <label> in a XHTML file by using DOM APIs.
e.g.
document.createTextNode(" );


The '&' is replaced by '& amp;'. (ignore the space ) so I am not able get the whilte space in the browser.
i.e.
I want to create elments as (ignore space)
<label class="" > & nbsp; </label>
or
<label class="" > & #160; </label>


thanks
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isn't this code works?


Also this question is more suitable for the HTML-JavaScript section.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are CDATA sections permissible in XHTML? Anything you put in one of those should go through unchanged.
 
Abhijit Das
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


is works, but code is not interpreting properly in the browser. because, the label is in
td
of table . So, only i want to place the line as shown in the last post.

And,
Hi Ulf Dittmer, can you explain how to write wiht CDATA to ignore. please send syntex for that.

thanks.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you write the whole "td" instead of "label",
like


JS:
 
Abhijit Das
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Actually, I am generating the XHTML file uisng DOM object of Java. In the XHTML, I want that format. so that while opening the file in browser, I will get a empty cell of a table .
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know how your're creating XHTML using Java, the code snippet for the same will help.
Meanwhile, take a look at how CDATA is defined for any tag, for your need, it goes like this:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic