[xslt] avoid self-closing tags on ouptut?



Are there any options for libxslt to cause self-closing tags to be emitted as a tag pair?

I've been using libxml2's html parser so that I can process html documents with xsltproc, but some tags emitted are invalid html; e.g.

<tt></tt>

after xslt processing becomes

<tt/>

which firefox hates and won't fix; see:
  https://bugzilla.mozilla.org/show_bug.cgi?id=521300

Quoting: "We uphold this (and the W3C Markup Working Group
agrees) so that people aren't tempted to try to throw XML constructs at these old user agents."

which I agree with, and where "XML constructs" seems to mean at least self-closing tags.

So although libxml2's html parsing of "tag soup" is a boon, unless I want to present the output as text/xml (which I do not) I'm in trouble.

I suppose could write some xslt to insert a comment in such empty nodes so that they are no longer empty...
<tt/> becomes <tt><!-- --></tt>

Sam


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