[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XML in education



Duane Morin writes:

 > > Is it also possible to have HTML inside XML to provide more tools and
 > > things (like graphics) to the quiz-designer?
 > 
 > In theory, yes, but it would be very difficult to write a DTD to handle that,
 > since you'd have to describe the whole of HTML inside EDUML.

Daniel P. Kionka writes:

 > It has a good visual representation of the TML structure, and it implies
 > that you can have HTML imbedded.

Yes, it's quite simple to embed one DTD in another. Here's an example
of a very simple DTD with one top-level element that includes one or
more HTML documents.

------ cut here ---------------------------------------------
<!--
"htmlwrap.dtd": a not-very-useful demonstration of embedding
-->

<!ENTITY % HTML PUBLIC
   "-//W3C//DTD HTML 4.0 Transitional//EN"
   "/usr/local/lib/sgml/html-4.0-trans.dtd">
%HTML;

<!ELEMENT htmlwrap - - (HTML+)>
------ cut here ----------------------------------------------

"-//W3C//DTD HTML 4.0 Transitional//EN"

is the public identifier, and

"/usr/local/lib/sgml/html-4.0-trans.dtd"

is the system identifier. Both will vary, of course, depending on
which HTML DTD you use.

%HTML;

imports the contents of the HTML DTD. If you want to redefine any of
the imported elements, you need to do it earlier in your DTD.

However, I've noticed a problem with this. According to my cursory
test -- I wrote a minimal document and parsed it with nsgmls -- the
above works as a full-SGML DTD. But if I do 

nsgmls -wxml test.xml

I get a lot of warnings about the HTML DTD ... apparently it's not
written in an XML-friendly style. I don't know XML well enough to know 
whether this would be a serious problem in practice.

Hope this helps a bit. Happy New Year to all!

Matt Gushee
Oshamanbe, Hokkaido, Japan