XSLT & HTML 4.01 Strict Options
VirtualRichard
Posted: Thursday, April 03, 2008 12:52:20 PM

Rank: Fanatic

Joined: 9/17/2007
Posts: 264
Location: London, UK.
To get compliant XSLT, I have to do something like <br/> & <input/>. That breaks validation on my site, which uses an HTML 4.01 Strict DocType (and there's a very good reason why this is in use, so shhh at the back ;)

How do I get my XSLT to output markup compliant to HTML 4.01?

Richard


2 * 3 * 3 * 37 : The prime factorisation of The Beast.
astuanax
Posted: Thursday, April 03, 2008 1:23:02 PM

Rank: Devotee

Joined: 7/20/2006
Posts: 89
Don't know if you still need the answer, but this how you force your output to html:

Code:
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="html"/>

dawoe
Posted: Thursday, April 03, 2008 1:41:45 PM

Rank: Aficionado

Joined: 1/19/2008
Posts: 170
Location: Belgium
astuanax wrote:
Don't know if you still need the answer, but this how you force your output to html:

Code:
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="html"/>



Haven't tried this solution yet, but I solved it this way :

Code:

<xsl:text><![CDATA[<div></div>]]></xsl:text>


I used this to create empty div tags, because some browsers have troubles with rendering <div />

Converting a DotNetNuke site to Umbraco : Follow it here
VirtualRichard
Posted: Thursday, April 03, 2008 3:28:51 PM

Rank: Fanatic

Joined: 9/17/2007
Posts: 264
Location: London, UK.
astuanax wrote:
Don't know if you still need the answer, but this how you force your output to html:

Code:
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="html"/>



Perfect. And, of course, I should have noticed that. Got a lot on my plate though, so do forgive d'oh!

2 * 3 * 3 * 37 : The prime factorisation of The Beast.
jHodgkinson
Posted: Thursday, April 03, 2008 9:42:30 PM
Rank: Fanatic

Joined: 3/15/2007
Posts: 378
Location: Cary, NC USA
in case you need to make sure your xhtml is compliant, all you have to do is add the following in your web.config under <system.web>:

<xhtmlConformance mode="Strict"/>

Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.