Thanks for looking into this extension!

On 03/13/2015 06:25 AM, Gabriel Riba wrote:
Although it is well explained in the manual (XML section), it is not easy to understand when there are several abstract concepts, that your mind easily skips.

Specially the type constructor "tag" it is confound with the value "tag" (that builds up xml subtrees with specific tag) but the different parameters they take augments the confusion.

The idea of separate namespaces for types and values is pretty common; Ur/Web inherits it from SML. You see the same thing with, e.g., class constructors in C++. I don't think it's inherently confusing, and usually it even improves understanding, by avoiding the need to add some extra nonsense prefix or suffix to an identifier for disambiguation.

> val svg : unit -> tag svgTagAttrs body svg [] []
>
> There is a quirk, since SVG can be an html level tag but also an
> inner svg fragment container, but I have not treated this case.

The "svg" tag establishes a new coordinate system. The fragments can be
set up with the grouping tag "g", without redefining the coordinate system.

I could not find a way to encode two possible outer context requirements for the svg tag.

Yeah, the XML encoding is not set up to support tags that work in multiple contexts where there is no single /most general/ context that subsumes all the options. Your example seems to need separate contexts for <body> and <svg>, where either case supports some tag that is not legal in the other.

One easy-to-implement workaround is to use a /separate tag/ for nested SVG, with a different name. Then modify src/monoize.sml to add a special case renaming that tag to <svg> in compiled code, for instance by copying the code in the place that maps "tabl" to "table" right now.
_______________________________________________
Ur mailing list
[email protected]
http://www.impredicative.com/cgi-bin/mailman/listinfo/ur

Reply via email to