Option 1 using XHTML is probably your best bet. We developed an XML
authoring system two or three years ago where we developed our own DTDs as
wrappers to XHTML, much in the way you are suggesting. At the time the XHTML
standard wasn't completed, so it involved a lot of cut-and-paste, but the
XHTML DTDs are now parameterized which means it should be relatively easy to
build your own DTDs which include the parts of XHTML you need for your
formatted text content.
This approach also makes XSLT conversions from your XML format to HTML
From: Jacob Palme [mailto:[log in to unmask]]
Sent: 02 March 2001 13:31
To: [log in to unmask]
Subject: Mixing XML and HTML
We are to produce a set of documents with answers to questions
about eating disorders. For each document, we want to store
several sets of different kinds of keywords, a title, and
a textual answer. We want to be able to include images and
tables in the answer, in those cases where this is suitable.
Documents are to be delivered to users as separate HTML pages,
as several answers together on a single HTML page, and maybe
also, some time in the future, in a special concise format
for mobile phones.
Question 1: What format should we use?
I understand that the keywords, title and the textual
answer can be different XML elements. No problem. But
what about the textual answer? Possible choices:
(1) Some kind of simplified HTML, may be XHTML, which
can be embedded in XML, maybe defined using the
ANY element type?
(2) Any HTML, included in the XML via references to a separate
file, in the same way as images and frames are handled
in ordinary HTML.
(3) Any HTML body text, using the "<![CDATA[" construct
to embed it in the XML text.
Are these the only choices? Any recommendations on how
to do it?
Question 2: Which of the following strategies for
translation to HTML should we use:
(a) Translate on the fly in the server when a page is
(b) Pretranslate and store HTML pages for direct delivery.
(c) Send XML to the web browser and instruct it to format
Question 3: Any recommendation of language to use to
transform from XML to HTML? Choices might be XSLT+CSS,
Java or some interpreted server-side language like PERL,
or some compiled language like C or Pascal.
P.S. You can see our very incomplete and unfinished site
to get an example of what kind of questions and answer
we want to use, at http://salut.nu/en/answers/. Please
do not link to this URL yet, until the site is more ready.
Jacob Palme <[log in to unmask]> (Stockholm University and KTH)
for more info see URL: http://www.dsv.su.se/jpalme/