# ERb question with xml

**URL:** <https://www.ruby-forum.com/t/erb-question-with-xml/96488>\
**Category:** Rails\
**Created:** [June 29, 2006, 12:25am UTC](https://www.ruby-forum.com/t/erb-question-with-xml/96488 "2006-06-29T00:25:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![brez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/eada6e/32.png) [@brez](https://www.ruby-forum.com/u/brez)\
**Post date:** [June 29, 2006, 12:25am UTC](https://www.ruby-forum.com/t/erb-question-with-xml/96488/1 "2006-06-29T00:25:07Z")

</div>

In the rdoc there’s an example:

xml.em { xml.b(“emp & bold”) }

Which produces:

_ **emph & bold** _

But what if I wanted to nest tags with text, i.e.:

_just emph and **emph & bold** _

?

I’ve messed around with it and have only gotten bizzare results or  
nothing displayed at all - any help appreciated - thanks

---

<div class="post-metadata">

**Author:** ![brez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/eada6e/32.png) [@brez](https://www.ruby-forum.com/u/brez)\
**Post date:** [June 29, 2006, 12:30am UTC](https://www.ruby-forum.com/t/erb-question-with-xml/96488/2 "2006-06-29T00:30:38Z")

</div>

On Thu Jun 29, 2006 at 12:25:07AM +0200, brez! !! wrote:

> _just emph and **emph & bold** _
> 
> ?

are you really making xml? or just abusing it to make HTML. if its the  
latter, try markaby:

em do  
text “just emph and”  
b “emph & bold”  
end

---

<div class="post-metadata">

**Author:** ![brez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/eada6e/32.png) [@brez](https://www.ruby-forum.com/u/brez)\
**Post date:** [June 29, 2006, 12:40am UTC](https://www.ruby-forum.com/t/erb-question-with-xml/96488/3 "2006-06-29T00:40:03Z")

</div>

> are you really making xml? or just abusing it to make HTML. if its the  
> latter, try markaby:
> 
> em do  
> text “just emph and”  
> b “emph & bold”  
> end

Yea I’m really making XML - it’s actually docbook so I want to able to  
do something like:

 Some text and then an inline word that appears in quotes.

---

<div class="post-metadata">

**Author:** ![brez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/eada6e/32.png) [@brez](https://www.ruby-forum.com/u/brez)\
**Post date:** [June 30, 2006, 6:19pm UTC](https://www.ruby-forum.com/t/erb-question-with-xml/96488/4 "2006-06-30T18:19:56Z")

</div>

answer:

xml.em {  
xml.text! “just emph and”; xml.b(“emp & bold”);  
}

and

xml.para {  
xml.text! “Some text and then an inline”; xml.quote(“word”); xml.text!  
“appears in quotes.”  
}
