[Ocaml-pxp-users] enable_namespace_info: good or bad?
Stefano Zacchiroli
zack at debian.org
Tue Oct 21 05:49:57 PDT 2003
Hi all,
I'm working with PXP on XML Schema document.
Such documents usually begin with something like:
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:target="http://www.example.org/foo"
targetNamespace="http://www.example.org/foo"
>
then in the rest of the document you can have reference to previous
defined stuff in this way:
<xsd:element ref="target:elt1" />
Here the target prefix matches the prefix used in the xmlns:target
declaration ... and here there's the problem!
I need to use PXP with XML Namespace support for various reasons. Using
PXP with namespace implies that xmlns: attributes are removed from the
representation of the schema element. Then prefix normalization is
applied and the only way to know the prefix used by the user is to use
enable_namespace_info parser configuration option.
I'm a bit scared about using that option because the comments tell that
it requires a lot of memory and that is "very very very very very
experimental" ... Furthermore I just need to have namespace_info on the
root element, not on all elements of the document.
Solutions that come into my mind are:
- ask the namespace manager which prefix got bound to
http://www.example.org/foo ==>>
not safe because namespace normalization could have choosen a prefix
different from the one used by the user ...
- perform first a non namespace aware parsing phase and look at the
xmlns: attributes ==>>
terribly slow
Other ideas?
TIA
--
Stefano Zacchiroli -- Master in Computer Science @ Uni. Bologna, Italy
zack@{cs.unibo.it,debian.org,bononia.it} - http://www.bononia.it/zack/
" I know you believe you understood what you think I said, but I am not
sure you realize that what you heard is not what I meant! " -- G.Romney
More information about the Ocaml-pxp-users
mailing list