# Changing Xml version in sinatra

**URL:** <https://www.ruby-forum.com/t/changing-xml-version-in-sinatra/175342>\
**Category:** Ruby\
**Created:** [September 11, 2009, 2:08pm UTC](https://www.ruby-forum.com/t/changing-xml-version-in-sinatra/175342 "2009-09-11T14:08:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![virendra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/e68b1a/32.png) [@virendra](https://www.ruby-forum.com/u/virendra)\
**Post date:** [September 11, 2009, 2:08pm UTC](https://www.ruby-forum.com/t/changing-xml-version-in-sinatra/175342/1 "2009-09-11T14:08:27Z")

</div>

hello to all

```
I have been working on sinatra for quite while now and i found it
as great as Rails

I recently constructed a sintra application that return result in
Xml format

all i wanted to know

```

1. how do i change the xml version of the generated xml  
because currently “xml.instruct!”  
generate the xml with version “1.0”  
i needed to change it to version “1.1”

2. Iam using sinatra application to interact with the other  
applications  
Now currently the response time for sinatra is fluctuating.  
as in the sinatra application seem to take different time for  
for same request each time queried to it  
i.e sometimes it takes less a second or so to return back the  
response  
the other time it take more than five second to do so.  
any thought on why it is happening and what can i do to  
bring down the 5+ second response time to less than a second

Thanks anyway

---

<div class="post-metadata">

**Author:** ![virendra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/e68b1a/32.png) [@virendra](https://www.ruby-forum.com/u/virendra)\
**Post date:** [September 11, 2009, 2:36pm UTC](https://www.ruby-forum.com/t/changing-xml-version-in-sinatra/175342/2 "2009-09-11T14:36:03Z")

</div>

On Fri, Sep 11, 2009 at 8:08 AM, Virendra N.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 1. how do i change the xml version of the generated xml  
> because currently “xml.instruct!”  
> generate the xml with version “1.0”  
> i needed to change it to version “1.1”

Really more of a question about Builder than Sinatra. The instruct!  
method takes optional arguments, unfortunately you either take the  
defaults or override everything so

```
   xml.instruct!(:xml, :version => '1.1', :encoding => 'UTF-8')

```

> bring down the 5+ second response time to less than a second  
> Well this depends somewhat on your actually application, somewhat on  
> the server os, and somewhat on how you’d deployed it  
> (mongrel/mongrel-cluster/passenger/???) This is the same for Sinatra,  
> Rails or any other server app.

Processing delays might mean that you don’t have enough daemon  
processes, if they are all busy when a new request comes in, the  
request will need to wait, either for a daemon to finish, or a new one  
to be spun up. It also may be that the server os is swapping  
processes out due to memory over-utilization. So there are quite a  
few variables here.

–  
Rick DeNatale

Blog: [http://talklikeaduck.denhaven2.com/](http://talklikeaduck.denhaven2.com/)  
Twitter: [http://twitter.com/RickDeNatale](http://twitter.com/RickDeNatale)  
WWR: [http://www.workingwithrails.com/person/9021-rick-denatale](http://www.workingwithrails.com/person/9021-rick-denatale)  
LinkedIn: [http://www.linkedin.com/in/rickdenatale](http://www.linkedin.com/in/rickdenatale)
