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

Re: XML to HTML transform validation problem

Subject: Re: XML to HTML transform validation problem
From: "Joe Fawcett" <joefawcett@xxxxxxxxxxx>
Date: Fri, 26 May 2006 08:22:30 +0100
html xmlns xs
If you're not using nodes in the http://www.w3.org/2001/XMLSchema namespace in your output than add exclude-result-prefixes="xs" to your stylesheet element.

--

Joe
----- Original Message ----- From: "Trevor Nicholls" <trevor@xxxxxxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Friday, May 26, 2006 7:56 AM
Subject: XML to HTML transform validation problem



I have a set of XML documents and a standard XML-HTML transformation which
is run in a pipeline; the XSL processor is Saxon 8.6.n (can't check at the
moment, but I think n=1).

Because of the way the stylesheet needs to process footnotes I have to use
some XSL 2.0 features, hence there is some typing in the stylesheet
(..as="xs:integer"..) and the stylesheet has to declare the xs namespace.

========= XSL ========
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="2.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:xs="http://www.w3.org/2001/XMLSchema" >
<xsl:output method="html" encoding="ISO-8859-1" indent="no"
  doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
  doctype-system="http://www.w3.org/TR/html4/loose.dtd" />

<xsl:template match="/document">
<html>
<head>
  <title><xsl:value-of select="title" /></title>
</head>
<body>
  ...etc...
</body>
</html>
...etc...
=====================

I am putting the generated HTML through the HTML validator (at
http://validator.w3.org) and getting errors; the first of which is

 Error: there is no attribute "XMLNS:XS".
 <html xmlns:xs="http://www.w3.org/2001/XMLSchema"><head><title...

If I drop the xmlns:xs declaration from my stylesheet (and comment out the
2.0 features it uses) then the <html> element does not declare the
namespace, but this isn't the right answer! I can see plenty of example HTML
outputs on the standard XSL websites which declare the same namespace, so
what additional step do I have to take to produce output which validates? I
can't believe that everybody's examples would fail the validation tests, so
obviously I've missed something.


Thanks for any help

Cheers
Trevor

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.