What I want:
document.write("She said "Run away!"");
but the generated code is:
document.write("She said "Run away!"");
Obviously a post-processor can't simply replace EVERY " in the line, or the
script becomes invalid. But how do you know which to replace and which not? I
suppose you could parse the script and try replacing the ones that are necessary
for the script to be valid, but then you would need separate processors/parsers
for each type of script language that might be in the script.
As much as possible, a workaround would be to use external scripts that are never
processed at all, but are pointed to with the optional SRC attribute on the
SCRIPT tag. This only works for scripts that don't have to be dynamically
generated, though.
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.
Eddie
David Megginson wrote:
> Chris Maden writes:
>
> > Support for pre-XML HTML was explicitly considered and rejected by
> > the Working Group.
>
> Absolutely correct.
>
> 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. If the XML document
> contains the same element types as the HTML, the translation will be
> very simple.
>
> All the best,
>
> David
>
> --
> David Megginson david@megginson.com
> http://www.megginson.com/
>
> xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
> Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
> To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
> (un)subscribe xml-dev
> To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
> subscribe xml-dev-digest
> List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)