# Entity Replacement

**URL:** <https://www.ruby-forum.com/t/entity-replacement/139348>\
**Category:** Rails\
**Created:** [June 3, 2008, 4:57am UTC](https://www.ruby-forum.com/t/entity-replacement/139348 "2008-06-03T04:57:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hloooi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/f17d59/32.png) [@hloooi](https://www.ruby-forum.com/u/hloooi)\
**Post date:** [June 3, 2008, 4:57am UTC](https://www.ruby-forum.com/t/entity-replacement/139348/1 "2008-06-03T04:57:54Z")

</div>

hi… can some one please explain this to me? im not clear what its  
actually means… thx for helping~~~

doc = Document.new(’\<!DOCTYPE foo []\>replace  
&ent;’,{:raw=\>:all})  
doc.root.text #-\> “replace &ent;” doc.to\_s # Generates: #  
\<!DOCTYPE foo [ # #  
]\>replace &ent;

and shud i place it in the xml file or …other places?

cheers
