XML Builder - xml header

for some reason, i am getting an extra:

<?xml version = "1.0"?>

in my xml file…

i am using a file called:

lastLogins.rxml

and the code looks like:

xml = Builder::XmlMarkup.new
xml.instruct! :xml, :version=>“1.0”, :encoding => ‘ISO-8859-1’

xml.loginData do
@lastLogins.each do |login|
xml.entry do
xml.user(login.user)
xml.timestamp(login.timestamp)
end
end
end

this ends up inserting both headers:

<?xml version = "1.0"?> <- from some mystery location..

and:

<?xml version="1.0" encoding="ISO-8859-1"?> <- as specified by builder

followed by all the correct data with the correct layout…

anyone have any ideas?

thanks so much!

On 3-jul-2006, at 18:03, sergio ruiz wrote:

xml = Builder::XmlMarkup.new

I think this is your culprit. Usually you don’t need to create a
builder explicitly.

Julian ‘Julik’ Tarkhanov
please send all personal mail to
me at julik.nl

xml = Builder::XmlMarkup.new

I think this is your culprit. Usually you don’t need to create a
builder explicitly.

i just tried it without that line, and i still get the header…

here is the code i just tried:

xml.loginData do
@lastLogins.each do |login|
xml.entry do
xml.user(login.user)
xml.timestamp(login.timestamp)
end
end
end

<?xml version = "1.0"?> <- this header was included...

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