[Ur] Howto make urweb generate invalid XHTML code?

Marc Weber marco-oweber at gmx.de
Sat Dec 11 19:19:51 EST 2010


Its getting worse:

http://impredicative.com/ur/demo/Demo/Tree/main

Insert this into the w3c validator:
(14 errors).


The dtd says:

  <!ELEMENT ul (li)+>

which means an ul must contain one ore more li elements. However the ur
code of the demo looks like this:

    fun recurse (root : option key) =
                    queryX' (SELECT * FROM tab WHERE {eqNullable' (SQL tab.{parent}) root})
                            (fn r =>
                                children <- recurse (Some r.Tab.id);
                                return <xml>
                                  <li> {f r.Tab}</li>
                                  
                                  <ul>
                                    {children}
                                  </ul>
                                </xml>)


which results in HTML code like this:

  <ul>
    <li>...</li>
    <ul>          <- only <li> tags allowed here.
  </ul>

So in that case ur doesn't even validate nesting order of tags (which
WASH showed that its possible easily)

So what's happening here?

Marc Weber



More information about the Ur mailing list