The XHTML schema defines the html element like this:
<xs:element name="html">
<xs:complexType>
<xs:sequence>
<xs:element ref="head"/>
<xs:element ref="body"/>
</xs:sequence>
<xs:attributeGroup ref="i18n"/>
<xs:attribute name="id" type="xs:ID"/>
</xs:complexType>
</xs:element>
So there is a global element declaration named "html", but its type is
anonymous.
You can only use xsl:type="htmlType" when there is a type definition in the
schema of the form
<xs:complexType name="htmlType">
Michael Kay
-----Original Message-----
From: Andrew Welch [mailto:andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com]
Sent: 31 January 2008 16:50
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] XHTML result validation using xsl:type
Given this setup:
xpath-default-namespace="http://www.w3.org/1999/xhtml"
<xsl:import-schema
namespace="http://www.w3.org/1999/xhtml"
schema-location="http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd"/>
<xsl:template match="/">
<html xsl:type="html">
This currently causes the error:
There is no type named html in an imported schema
URL: http://www.w3.org/TR/xslt20/#err-XTSE1520
But using xsl:validation="strict" works without error.
<xsl:template match="/">
<html xsl:validation="strict">
I'm guessing it's some problem with the default namespace,
but I thought this should work.
The spec says:
"The [xsl:]type attribute takes as its value a QName. This
must be the name of a type definition included in the
in-scope schema components for the stylesheet. If the QName
has no prefix, it is expanded using the default namespace
established using the effective [xsl:]xpath-default-namespace
attribute if there is one; otherwise, it is taken as being a
name in no namespace."
http://www.w3.org/TR/xslt20/#validation-xsl-type
Should xsl:type work as expected here, or am I missing something?
Using Saxon 9.0.
thanks
--
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--