This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: XHTML to HTML 4
- To: xsl-list at mulberrytech dot com
- Subject: Re: XHTML to HTML 4
- From: Mike Brown <mike at skew dot org>
- Date: Thu, 6 Apr 2000 13:37:13 -0600 (MDT)
- Reply-To: xsl-list at mulberrytech dot com
> I've got an xhtml document similar to this fragment:
>
> <html:table border="0" cellpadding="0" cellspacing="5px">
> <html:tr>
> <html:td>
> <html:span class="StoryHeadline">b</html:span>
Namespaces are inherited by element descendants; it shouldn't be necessary
to use the prefix all the way down, although total disambiguation
of element types isn't harmful.
> I need to convert this document to HTML 4
> <?xml version="1.0"?>
>
> <xsl:stylesheet
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:html='http://www.w3.org/1999/xhtml'
> exclude-result-prefixes="html"
> >
don't forget version="1.0"
("An xsl:stylesheet element must have a version attribute", the spec says.)
> <xsl:output method="text" />
Does your XSL processor support the "html" output method? They all do, as
far as I know. I would use <xsl:output method="html" /> and let the
processor do the dirty work. That's what this method is for!
All you have to do then in your stylesheet is make a copy of the source
tree. You could use the identity transformation from the xsl:copy example
in the spec.
-Mike
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list