Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 24th, 2004, 08:09 AM
Authorized User
 
Join Date: Jul 2004
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default producing XHTML from XSLT

Not sure if I'm being dense here, but I don't seem to be able to produce valid XHTML from my stylesheet.

I've got:

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

<xsl:output
  method="html"
  encoding="UTF-8"
  omit-xml-declaration="yes"
  doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
  doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
  indent="yes" />

In the head of my stylesheet. However, in the result document my META tags are produced unclosed i.e. <meta content="item" name="meta_name">
and my <br /> tags become <br>

All of this, of course, causes it to fail the w3c validator for XHTML 1.0 Transitional.

Is this a problem with my XSLT or with the java Transformer classes?

hmk
 
Old August 24th, 2004, 09:00 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

If you ask for method="html" you will get HTML, not XHTML.

To produce XHTML, use method="xml". Some XSLT 1.0 processors also support method="xhtml" but it's not standard until XSLT 2.0.



Michael Kay
http://saxon.sf.net/





Similar Threads
Thread Thread Starter Forum Replies Last Post
XSLT for parsing XHTML Form shahbhat XSLT 6 August 26th, 2008 06:22 PM
xhtml input tag not rendered correctly by xslt dude153 XSLT 4 December 14th, 2007 02:04 PM
xslt -> xhtml validation rahulsk1947 XSLT 3 May 17th, 2007 02:54 AM
Converting XHTML to Word ML using XSLT debsoft XSLT 1 July 7th, 2004 04:36 AM
XHTML to Word ML using XSLT debsoft XSLT 0 June 26th, 2004 04:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.