On Mon, Sep 7, 2009 at 9:17 PM, Grant Wood <smackt...@gmail.com> wrote:

>
> Hello Lifters,
>
> If I create a template with the following:
>
> <lift:surround with="page_master" at="content">
>  <a class="thickbox" href="/media/?height=440&width=640">Foo</a>
>  <lift:bind name="content" />
> </lift:surround>
>
> I will be served an empty page, containing none of my snippets, and
> throwing or logging no errors.  By "empty" I mean, the page contains
> only the outermost xhtml which Lift wraps a page with (liftajax, xml
> declaration, etc.) but nothing from any of my own templates or
> snippets.
>
> Very odd.
>
> On a hunch, I escaped the & to &amp; and suddenly the page appeared
> fully rendered. i.e.:
> <a class="thickbox" href="/media/index.xml?
> height=440&amp;width=640">Foo</a>
>
> My first concern is that I should not have had to escape the & at all
> in an attribute.  This is a valid character in any XML attribute.
>

& is not a valid character in an XML attribute.  The & character must be
escaped as &amp;


>
> Second, if there is some reasonable lift-specific reason that I need
> to escape "&" in attributes, then shouldn't Lift decode each &amp;
> back to "&" inside attributes upon page rendering?  ( and if that's
> the case, then couldn't that same test be used to prevent the need to
> escape the "&" in the first place?)
>

Lift yields valid XHTML to the browser.  &amp; is valid xhtml, <a href='
http://something?height=440&width=660'> is *not* valid XHTML and will be
rejected by your browser.


>
> I am using lift 1.1-SNAPSHOT
>
> Thanks for your comments.
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to