[Ur] Howto make urweb generate invalid XHTML code?
Marc Weber
marco-oweber at gmx.de
Sat Dec 11 20:35:33 EST 2010
Excerpts from Adam Chlipala's message of Sun Dec 12 02:02:31 +0100 2010:
> You're not seeing some deep technical limitation in Ur/Web, which _does_
> check nesting order of tags in a 100% sound way. Rather, I wasn't aware
> of this XHTML restriction when I wrote the types for the standard
> library's HTML tag combinators. Such code displays well in all the
> major browsers, right? I'm not sure it's worth changing, since that
> means more complicated types in the standard library.
It is. For this reasons:
Customers hear that pages should validate. So they find a validator and
try to validate a page. If they see 20 errors although the page should
be guaranteed to be bug free ..
But maybe its not that important right now.
Are those the lines which specify HTML tag orders?
val p : bodyTag boxAttrs
I tried enhancing the WASH idea and tried writing a XML library for
Haskell which does 100% validation. However learning about the <ul>
thing I also introduced a "fuzzier" wash like checking.
It should be easy to tweak my library outputting the ur code instead of
Haskell code. It reads the .dtd file.
Now I know why I never found the dtd spec in urweb :)
I'd be interested in how fast urweb still is if you do a more strict
validation (let's say ensure 100% of tag order)
I loved the head declaration most (XHTML strict):
<!ELEMENT head (%head.misc;,
((title, %head.misc;, (base, %head.misc;)?) |
(base, %head.misc;, (title, %head.misc;))))>
Note how you have two choices to put title !
Trying to verify this can be done - but its getting really really funny
then :)
I really don't get why they made the standard that complicated - and
probably browsers won't care anyway - but validators do ;)
Marc Weber
More information about the Ur
mailing list