[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Apologies and 2 questions

Subject: Re: Apologies and 2 questions
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Mon, 23 Jul 2001 10:56:50 +0100
saxon xhtml br output
Hi Nathan,

> BUT, when the XML is parsed by the XSLT, it outputs the <br /> tag
> as <br>. If I am using the XHTML1.0 Transitional DTD to define my
> output, it will not validate. It needs to be output as <br />. Same
> goes for any other standalone tags <img />, <hr />, <input />,
> etc.... Does that make sense?

Yes. You are using the 'html' output method when you want the output
to be XML. To make the processor output well formed XML, you need to
use the 'xml' output method:

<xsl:output method="xml" />

The empty elements will be output as empty elements and so on.
*However* the XML output method has no awareness that it is outputting
XHTML, so it doesn't do some things that you get automatically from
the HTML output method, like nice character entity references and
escaping of URI attribute values. It also means that you probably
don't get the compatibility features of XHTML, like having a space
before the / in empty elements.

To have that kind of stuff done for you, you really need a dedicated
XHTML output method. Some processors offer this as an extension output
method, for example Saxon allows you to do:

<xsl:output method="saxon:xhtml" />

(An XHTML output method is something that *might* be supported in XSLT
2.0 - it's requirement 1.8, but only a 'could'.)

The other option is outputting HTML and then tidying it into XHTML
with HTML Tidy.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.