EMBED and validation

David G. Durand dgd at cs.bu.edu
Sat Nov 29 22:03:15 GMT 1997


At 4:46 PM -0000 11/29/97, Peter Murray-Rust wrote:
>The only area of fuzziness is what the default and optional behaviours of a
>parser (sic) are. If I write:

I don't think there is any fuzziness at all.

>
><!DOCTYPE HTML SYSTEM "html20.dtd" [
><!ENTITY pythagoras SYSTEM "pythagoras.xml"> <!-- in MathML -->
>]>
><HTML>
><HEAD>...</HEAD>
><BODY>
><P>This is Pythagoras' theorem:<BR>
>&pythagoras;
></P>
></BODY>
></HTML>
>
>and I run it through a parser what will happen? The answer is
>parser-dependent. It might:
>	- always include and validate external entities in which case there
>will
>be a validation error (MathML uses a different DTD from HTML). If the
>entity is valid, then it creates a 'single document' which is easy to
>search, etc. One disadvantage is that (for Java) the document could get too
>big for the JVM.

If the MathML elements are not declared in the DTD, _no_ validating parser
can ever accept this as legal.

>
>	- offer a commandline switch that allows inclusion of external
>entities OR
>defers their expansion to the application/processor. In that case the
>*application* has to be able to able to run a parser over the 'included'
>MathML.

No, external entities are parsed in place. WF-only applications might not
follow the entities (under user choice, whether interactive or
command-line), or they might folliow them and present the information.
Parsing relative to a different DTD would be unfortunate behavior, since
validation should be done according to the rules of XML.

Of course, a WF application might jsut swallow the elements and use its own
stylesheet language to format some math.

>(JUMBO can do this at present - it can even use a different parser from the
>initial one, which may be useful if they have different behaviours).

You mean if they have bugs?

>Note, of course, that an application may  also want to run a validating
>parser over the targets of HREF and JUMBO can do this as well.

sure... it could, but that would be odd, since you can't include a _valid_
XML document into either a valid or a well-formed document, since the
Doctype delcaration is not legal in the isntance.

You would have to to refer to the external entity using an ENTITY
attribute, rather than expanding it via an entity reference if you want to
make valid use of this kind of processing based on entities.

  --  David

_________________________________________
David Durand              dgd at cs.bu.edu  \  david at dynamicDiagrams.com
Boston University Computer Science        \  Sr. Analyst
http://www.cs.bu.edu/students/grads/dgd/   \  Dynamic Diagrams
--------------------------------------------\  http://www.dynamicDiagrams.com/
MAPA: mapping for the WWW                    \__________________________



xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list