ocsigen / ocsigen/tyxml

Handling of XML namespaces

Open
#277 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
OCaml
Stars
179
Forks
63
Avg merge
5h
Merged PRs (30d)
22

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the namespace handling around lib/svg_f.ml#L740-L742 and the Svg and Html functor interfaces. Compare how a shared XML instance is used and how the root SVG element is treated. Done means the namespace behavior is decided consistently and the resulting caveat is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.