DAZ, are you using Google Chrome for your development?
Nathan, I think I found the problem and it has nothing to do with
HAML, I'm sorry to bother you with this.

If you right click "View Page Source" in Google Chrome it shows the
source of the document but *HIDES* the XML declaration. I opened the
same file in Firefox, right click "View Page Source" and tadaa, there
it is. Checked Safari and sure, it's there.

So conclusion: for some strange reason Google Chrome doesn't think
it's important to show the XML declaration in the source view. If you
use Webkit's resource inspector (View > Developer > Developer Tools)
and look at the source that way you'll see it's there.

So DAZ, can you confirm you are having this problem in Google Chrome
as well and not in another browser so that we can be sure we are
talking about the same problem here?

And Nathan... sorry, should have double checked before complaining.

Good night!

On Aug 27, 10:55 pm, Nathan Weizenbaum <[email protected]> wrote:
> Something strange is going on here. Haml should pass all lines beginning
> with "<" straight through to source. I'll check it out some time this
> weekend.
>
>
>
> On Fri, Aug 27, 2010 at 11:54 AM, Peter <[email protected]> wrote:
> > I tried to add the XML declaration manually with:
>
> > DOESN'T WORK
> > --------- app/views/layouts/application.html.haml
> > <?xml version="1.0" encoding="utf-8"?>
> > ---------
>
> > But this doesn't show anything. Adding a *space* before the question
> > mark does show the tag. Is there some regex stuff going on here that
> > rejects tags that start with a question mark?
>
> > WORKS, MIND THE SPACE
> > --------- app/views/layouts/application.html.haml
> > < ?xml version="1.0" encoding="utf-8"?>
> > ---------
>
> > Hope this helps pointing in the right direction.
>
> > On Aug 27, 8:36 pm, Peter <[email protected]> wrote:
> > > Hi DAZ and Nathan,
>
> > > I have exactly the same problem in a Rails 3 RC 2 application. Started
> > > an application from scratch with only the HAML gem, ran a 'bundle
> > > install' and added an haml.rb file in the config/initializers file
> > > which sets the default to :xhtml, here it is:
>
> > > --------- config/initializers/haml.rb
> > > Haml::Template.options[:format] = :xhtml
> > > ---------
>
> > > Next I have the following in my application.html.haml:
>
> > > --------- app/views/layouts/application.html.haml
> > > !!! XML
> > > %p This file should have an XML declaration but doesn't.
> > > ----------
>
> > > When I remove the XML or replace it with 5, Mobile or any other tag it
> > > works fine but the XML is ignored. Am I missing something?
>
> > > Thanks!
>
> > > On Aug 27, 3:54 pm, DAZ <[email protected]> wrote:
>
> > > > Thanks Nathan,
> > > > I'm using Sinatra 1.0. I tried using :format => :xhtml and still the
> > > > same problem! Not sure what's going on...
>
> > > > DAZ
>
> > > > On Aug 26, 7:07 pm, Nathan Weizenbaum <[email protected]> wrote:
>
> > > > > You're probably using Rails 3, in which case Haml defaults to HTML5
> > format,
> > > > > in which XML headers don't show up. You need to set :format => :xhtml
> > for
> > > > > this to work.
>
> > > > > On Thu, Aug 26, 2010 at 8:02 AM, DAZ <[email protected]> wrote:
> > > > > > I'm using the following code to generate an rss feed:
>
> > > > > > !!! xml
> > > > > > %feed(xmlns="http://www.w3.org/2005/Atom";)
> > > > > > %title= settings.title
> > > > > > %id= settings.url
> > > > > > %updated= @posts.first[:created_at] if @posts.any?
> > > > > > %author
> > > > > >  %name= settings.author
>
> > > > > > But the output is this:
> > > > > > <feed xmlns='http://www.w3.org/2005/Atom'></feed>
> > > > > > <title>Bloggl</title>
> > > > > > <id>http://bloggl.com</id>
> > > > > > <updated>2010-08-26T15:37:35+01:00</updated>
> > > > > > <author>
> > > > > >  <name>DAZ</name>
> > > > > > </author>
>
> > > > > > The !!! xml line doesn't seem to be producing
> > > > > > <?xml version = "1.0" encoding = "UTF-8"?>
>
> > > > > > Anybody know what's going wrong here?
>
> > > > > > cheers,
>
> > > > > > DAZ
>
> > > > > > --
> > > > > > You received this message because you are subscribed to the Google
> > Groups
> > > > > > "Haml" group.
> > > > > > To post to this group, send email to [email protected].
> > > > > > To unsubscribe from this group, send email to
> > > > > > [email protected]<haml%[email protected]><
> > haml%[email protected]<haml%[email protected]>
> > >.
> > > > > > For more options, visit this group at
> > > > > >http://groups.google.com/group/haml?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Haml" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected] <haml%[email protected]>.
> > For more options, visit this group at
> >http://groups.google.com/group/haml?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/haml?hl=en.

Reply via email to