Hi folks! With XmlBuilder it is possible to set the xml header via instruct: xml.instruct!(:xml, :version=>"1.0",:encoding=>"iso-8859-1") This produces: <?xml encoding="iso-8859-1" version="1.0"?> Which is not parseable by many XML parsers for the attribute version must come first :-( What to do? Yours, Lars -- "Stil ist die Fähigkeit, komplizierte Dinge einfach zu sagen - nicht umgekehrt." -- Cocteau, Jean
Right i noticed this too, i generally don''t use the instruct directive. But we should really ping the author of builder about this. On Sat, 8 Jan 2005 11:03:38 +0100, Lars Hoss <woeye-DgJLf6aGC0jR7s880joybQ@public.gmane.org> wrote:> Hi folks! > > With XmlBuilder it is possible to set the xml header via instruct: > > xml.instruct!(:xml, :version=>"1.0",:encoding=>"iso-8859-1") > > This produces: > > <?xml encoding="iso-8859-1" version="1.0"?> > > Which is not parseable by many XML parsers for the attribute version > must come first :-( > What to do? > > Yours, > Lars > > -- > "Stil ist die Fähigkeit, komplizierte Dinge einfach zu sagen - nicht > umgekehrt." -- Cocteau, Jean > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Tobi http://www.hieraki.org - Open source book authoring http://blog.leetsoft.com - Technical weblog
On Saturday 08 January 2005 11:49 am, Tobias Luetke wrote:> But we should really ping the author of builder about this.Done. "gem install builder" fixes all. I thought "attributes" in general were order independent. Are there other instances in XML where "attribute" order is important? XML gurus, feel free to respond. -- -- Jim Weirich jim-Fxty1mrVU9GlFc2d6oM/ew@public.gmane.org http://onestepback.org ----------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
Hi!> On Saturday 08 January 2005 11:49 am, Tobias Luetke wrote: >> But we should really ping the author of builder about this. > > Done. "gem install builder" fixes all.Wow! That was fast! Thanks, Jim. The Rails community simply rock! :-)> I thought "attributes" in general were order independent. Are there > other > instances in XML where "attribute" order is important? XML gurus, > feel free > to respond.I thought they were order independent, too. I guess in most cases they are. But the xml-header seems to be a special case. Yours, Lars> -- > -- Jim Weirich jim-Fxty1mrVU9GlFc2d6oM/ew@public.gmane.org http://onestepback.org > ----------------------------------------------------------------- > "Beware of bugs in the above code; I have only proved it correct, > not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas) > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >-- "Stil ist die Fähigkeit, komplizierte Dinge einfach zu sagen - nicht umgekehrt." -- Cocteau, Jean
Michael Koziarski
2005-Jan-09 08:58 UTC
Re: How to set a correct xml header with XmlBuilder?
On Sun, 9 Jan 2005 09:35:46 +0100, Lars Hoss <woeye-ee4meeAH724@public.gmane.org> wrote:> Hi! > > > On Saturday 08 January 2005 11:49 am, Tobias Luetke wrote: > >> But we should really ping the author of builder about this. > > > > Done. "gem install builder" fixes all. > > Wow! That was fast! Thanks, Jim. > The Rails community simply rock! :-) > > > I thought "attributes" in general were order independent. Are there > > other > > instances in XML where "attribute" order is important? XML gurus, > > feel free > > to respond. > > I thought they were order independent, too. I guess in most cases they > are. But the xml-header seems to be a special case.The only case I can see is the processing directive: XMLDecl ::= ''<?xml'' VersionInfo EncodingDecl? SDDecl? S? ''?>'' http://www.w3.org/TR/2000/REC-xml-20001006#sec-prolog-dtd> Yours, > Lars > > > -- > > -- Jim Weirich jim-Fxty1mrVU9GlFc2d6oM/ew@public.gmane.org http://onestepback.org > > ----------------------------------------------------------------- > > "Beware of bugs in the above code; I have only proved it correct, > > not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas) > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > -- > "Stil ist die Fähigkeit, komplizierte Dinge einfach zu sagen - nicht > umgekehrt." -- Cocteau, Jean > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Cheers Koz