[Ocaml-pxp-users] enable_namespace_info: good or bad?
Gerd Stolpmann
info at gerd-stolpmann.de
Thu Oct 23 09:56:56 PDT 2003
Am Don, den 23.10.2003 schrieb Stefano Zacchiroli um 09:21:
> Just to understand your implementation choices. Prefix normalization is
> ok, but why remove the xmlns:... esplicit attributes from nodes. Is it
> required by the Infoset+Namespaces recommendations? Having that
> attributes should be enough ...
The Infoset separates namespace declarations from normal attributes, but
namespace declarations are still accessible. Other standards (e.g.
XPath, XQuery) do not consider namespace declarations as attributes.
One way to go would be to follow Infoset and add a namespace_attributes
method to XML nodes. However, I fear this addition raises more questions
than it solves, because the namespace_attributes will usually get out of
date after tree transformations. That means, namespace-aware serializers
will disregard the namespace_attributes, and instead output namespace
declarations as required by the actual namespaces (this phenomenon is
discussed under the term "synthetic infoset").
In contrast to this, my proposal is transparent for transformations,
because the scope objects always contain all declared prefixes at a
certain location in the tree, so they can be copied to another place,
and the scope is kept intact. BTW, in the Infoset, there are "Namespace
Information Items" (attached to elements) with a similar idea. In XPath,
there are "Namespace Nodes" for this feature.
> > What do you think about this proposal?
>
> It solves the problem requiring not so much memory, but I think it's
> quite heavy for the programmer ... unfortunately I actually see no
> cleaner way for improving the current namespace_info stuff, so go for it
> :-)
I don't think it will be heavy for the user of the API (maybe for me).
There will just be a number of additional things one can query.
There will be some overhead if one wants to create a synthetic (i.e.
non-parsed) document that has a scoping structure. This is not a
disadvantage, because this currently not possible. So you only get
additional features.
> Finally, even if namespace_info stuff was not granted to be stable, it
> would be possible to be, at least for one release, backward compatible?
Granted.
Gerd
--
------------------------------------------------------------
Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany
gerd at gerd-stolpmann.de http://www.gerd-stolpmann.de
------------------------------------------------------------
More information about the Ocaml-pxp-users
mailing list