[Ocaml-pxp-users] The meaning of ANY
Gerd Stolpmann
gerd at gerd-stolpmann.de
Fri Jan 29 16:36:16 PST 2010
Am Freitag, den 29.01.2010, 14:30 -0800 schrieb Dario Teixeira:
> Hi,
>
> There's a high probability this is not a problem with PXP per se, but
> rather with my interpretation of the DTD specs. Anyway, the situation is
> as follows: I have a "document" consisting of a non-empty list of blocks.
> A block may be either "mathtexblk" or "mathmlblk". In the former case it
> contains only PCDATA; in the latter case the element's contents are supposed
> to be a MathML fragment.
>
> Now, some other component will attest to the validity of this fragment in
> accordance to the MathML DTD; all I care about at this stage is that the
> contents for a mathmlblk element are well-formed. It is for this reason
> that I've used the declaration ANY for the mathmlblk element:
>
> <!ELEMENT document (mathtexblk | mathmlblk)+>
> <!ELEMENT mathtexblk (#PCDATA)>
> <!ELEMENT mathmlblk ANY>
>
> This isn't working though; PXP throws a "Validity constraint" error, and it
> seems that ANY is being interpreted as "any element declared in this DTD",
> instead of my expectation of "any element, really". Is PXP's behaviour
> according to spec, and if so, is there a workaround you could suggest?
Yes. It has nothing to do with ANY in particular, but a valid document
requires that all elements are declared in the DTD. ANY does not weaken
this restriction.
PXP has an option that allows undeclared elements
(put <?pxp:dtd optional-element-and-notation-declarations?> into the
DTD), so that you practically get the effect you want. Look at
intro_advanced.txt in the distribution for more documentation.
Gerd
--
------------------------------------------------------------
Gerd Stolpmann, Bad Nauheimer Str.3, 64289 Darmstadt,Germany
gerd at gerd-stolpmann.de http://www.gerd-stolpmann.de
Phone: +49-6151-153855 Fax: +49-6151-997714
------------------------------------------------------------
More information about the Ocaml-pxp-users
mailing list