Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling of XML namespaces #277

Open
let-def opened this issue Oct 28, 2020 · 0 comments
Open

Handling of XML namespaces #277

let-def opened this issue Oct 28, 2020 · 0 comments

Comments

@let-def
Copy link

let-def commented Oct 28, 2020

Right now, Svg and Html functors takes the same XML parameter, but their respective elements should not be instantiated in the same namespace (svg elements "live" in http://www.w3.org/2000/svg).
The current workaround is to pass a different XML instance, manually specialized for a namespace.

But this is also done explicitly by Tyxml only for the root svg element: https://github.com/ocsigen/tyxml/blob/master/lib/svg_f.ml#L740-L742. It would be nice if the behavior was consistent: pass the namespace for all elements or for none.
Actually, none is probably a better solution since, as far as the DOM is concerned, xmlns is not handled like a normal attribute (it changes the meaning of the rest of the syntax).

It seems ok if each instance of Xml has to handle that internally. This caveat should just be properly documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant