HTML != XML (was Re: [ANN] Kludgey workarounds for xt)

Andrew Bunner bunner at massquantities.com
Wed Sep 9 20:04:23 BST 1998


>It does seem odd that with the advent of the DOM which really eases
scripting and
>makes it much more powerful that almost simultaneously problems occur that
make
>generating those scripts more difficult.

  Odd is on way to describe it, I would say "frustrating".

>> Since HTML <= 4.0 is *not* XML, it is best to treat it as an output
>> format, like PDF, TeX, RDF, Postscript, etc. -- in other words, first
>> produce your XML, then run it through a filter (such as a SAX-based
>> app) that does a down-translation to HTML syntax.

  This doesn't have to be a very complicated animal. If I wanted to, I
could generate something that is ~almost~ HTML by doing things like <BR/>
and <IMG .../>. From there, a one line regular expression would make my
pages be readable by the major browsers. (Interesting aside, IE will
display the right thing if you close a stand-along tag with />, but
Netscape will not)

  It sounds like the smart thing to do is write an XML to HTML converter as
you suggest.

  The scripting workaround isn't as hard as it seems. You're example of...

document.write("She said &quot;run&quot;")

  ...would actually get turned into...

document.write(&quot;She said &amp;quot;run&amp;quot;&quot;)

  So, if we just go through and replace all the predefined entities with
the literal characters they represent, the workaround works.

  The fact that including a script in the generated file requires a
seperate utility will, I expect, become a non-trivial barrier to the
broader acceptance of XSL. I hope the working group chooses to address this
in their second draft.

  <stating-the-obvious>Java Script engines are not easy things to
write.</stating-the-obvious> I think it's unlikely that developers are
going to redefine the Java Script language to interpret &lt; as < ... my
opinion (hope) is that the standard should accomodate this.

-- Andrew

   Andrew Bunner
   President, Founder Mass Quantities, Inc.
   Professional Supplements for the Perfect Physique
   http://www.massquantities.com 

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