Changing Xml version in sinatra

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

On Fri, Sep 11, 2009 at 8:08 AM, Virendra N.
[email protected] 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/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs