# Generating xml tags with a period(.) in the tag name generating xml tags with a period(.) in generat

**URL:** <https://www.ruby-forum.com/t/generating-xml-tags-with-a-period-in-the-tag-name-generating-xml-tags-with-a-period-in-generat/119017>\
**Category:** Rails\
**Created:** [November 2, 2007, 6:13am UTC](https://www.ruby-forum.com/t/generating-xml-tags-with-a-period-in-the-tag-name-generating-xml-tags-with-a-period-in-generat/119017 "2007-11-02T06:13:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Usha\_Murali](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/8797f3/32.png) [@Usha\_Murali](https://www.ruby-forum.com/u/Usha_Murali)\
**Post date:** [November 2, 2007, 6:13am UTC](https://www.ruby-forum.com/t/generating-xml-tags-with-a-period-in-the-tag-name-generating-xml-tags-with-a-period-in-generat/119017/1 "2007-11-02T06:13:15Z")

</div>

Hi all,  
In ruby language, while generating xml tags with a period(.) in  
the tag name as given below, the xml builder gives me error, without  
the period it works fine Could  
anyone suggest me the solution. My rxml file is as follows:

xml.instruct! :xml, :version=\>“1.0”,  
:encoding=\>“UTF-8”  
xml.methodResponse do  
xml.param do  
xml.Date.iso8601(@date.strftime("%Y-%m-%dT%H:%M:%S"))  
end  
end

TIA

---

<div class="post-metadata">

**Author:** ![Usha\_Murali](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/8797f3/32.png) [@Usha\_Murali](https://www.ruby-forum.com/u/Usha_Murali)\
**Post date:** [November 2, 2007, 9:31am UTC](https://www.ruby-forum.com/t/generating-xml-tags-with-a-period-in-the-tag-name-generating-xml-tags-with-a-period-in-generat/119017/2 "2007-11-02T09:31:22Z")

</div>

On 2 Nov 2007, at 05:12, Usha Murali wrote:

> Hi all,  
> In ruby language, while generating xml tags with a period(.) in  
> the tag name as given below, the xml builder gives me error, without  
> the period it works fine Could  
> anyone suggest me the solution. My rxml file is as follows:

IIRC Builder gives you the tag! method which allows you to pass the  
name of the tag as a string.

Fred

---

<div class="post-metadata">

**Author:** ![Usha\_Murali](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/8797f3/32.png) [@Usha\_Murali](https://www.ruby-forum.com/u/Usha_Murali)\
**Post date:** [November 2, 2007, 10:57am UTC](https://www.ruby-forum.com/t/generating-xml-tags-with-a-period-in-the-tag-name-generating-xml-tags-with-a-period-in-generat/119017/3 "2007-11-02T10:57:19Z")

</div>

Hi Fred,  
Thanks for your quick reply, as per ur suggestion i have installed  
builder as follows:  
gem install builder  
Attempting local installation of ‘builder’  
Local gem file not found: builder\*.gem  
Attempting remote installation of ‘builder’  
Successfully installed builder-2.1.2  
Installing RDoc documentation for builder-2.1.2…

But I find difficulty in loading the builder library:

[root@rubyserver lib]# irb --simple-prompt

> > require ‘builder’  
> > LoadError: no such file to load – builder  
> > from (irb):1:in `require’  
> > from (irb):1

Also Please suggest me if I could achieve my requirement with this  
library, that I wanted the xml tage to include a period(.) in the tag  
as : \<Date.iso8601\>date\</Date.iso8601\>

---

<div class="post-metadata">

**Author:** ![Usha\_Murali](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/8797f3/32.png) [@Usha\_Murali](https://www.ruby-forum.com/u/Usha_Murali)\
**Post date:** [November 2, 2007, 10:59am UTC](https://www.ruby-forum.com/t/generating-xml-tags-with-a-period-in-the-tag-name-generating-xml-tags-with-a-period-in-generat/119017/4 "2007-11-02T10:59:41Z")

</div>

On 2 Nov 2007, at 09:56, Usha Murali wrote:

> Hi Fred,  
> Thanks for your quick reply, as per ur suggestion i have installed  
> builder as follows:

You’ve already got builder - it’s what you are already using.

Fred

---

<div class="post-metadata">

**Author:** ![Usha\_Murali](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/8797f3/32.png) [@Usha\_Murali](https://www.ruby-forum.com/u/Usha_Murali)\
**Post date:** [November 2, 2007, 11:51am UTC](https://www.ruby-forum.com/t/generating-xml-tags-with-a-period-in-the-tag-name-generating-xml-tags-with-a-period-in-generat/119017/5 "2007-11-02T11:51:46Z")

</div>

Fred ,

Kindly suggest me if I could achieve my requirement with this  
library, that I wanted the xml tage to include a period(.) in the tag  
as : \<Date.iso8601\>date\</Date.iso8601\>. It works fine without the  
period(.) in the tag - date.

Thanks,  
Usha

---

<div class="post-metadata">

**Author:** ![Usha\_Murali](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/8797f3/32.png) [@Usha\_Murali](https://www.ruby-forum.com/u/Usha_Murali)\
**Post date:** [November 2, 2007, 3:41pm UTC](https://www.ruby-forum.com/t/generating-xml-tags-with-a-period-in-the-tag-name-generating-xml-tags-with-a-period-in-generat/119017/6 "2007-11-02T15:41:21Z")

</div>

On 2 Nov 2007, at 10:50, Usha Murali wrote:

> Fred ,
> 
> Kindly suggest me if I could achieve my requirement with this  
> library, that I wanted the xml tage to include a period(.) in the tag  
> as : \<Date.iso8601\>date\</Date.iso8601\>. It works fine without the  
> period(.) in the tag - date.

Like I said before, the tag! method should allow this as you pass the  
name of the tag to create as a parameter.

Fred
