[xsl] XSLT 2 processing of W3C Schema expressed default attributes

Subject: [xsl] XSLT 2 processing of W3C Schema expressed default attributes
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 02 Sep 2003 11:24:05 -0400
Hi folks!

My expectations of the instance and document model below are that a schema-aware XSLT 2 processor will "see" the default attribute expressed in the W3C Schema expression and this attribute will show up in a copy-of for the entire document. I'm expecting the output <entry1> will have defattr="hello" included since I didn't specify such an attribute in the input.

The output running Saxon 7.6.5 doesn't show the default attribute and the documentation at http://saxon.sourceforge.net/saxon7.6.5/index.html doesn't discuss the PSVI, so I'm assuming I've messed up somewhere in the specification of the schema model ... but cannot see it in this simple example.

Can someone point me to where my mistake is and to which collection of XSLT 2 processors I can work with to see these default attributes?

Thanks for your help!

.................. Ken

V:\samp>type defattr.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<doc xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  <entry2 attr="CD"/>

V:\samp>type defattr.wxd
<?xml version="1.0" encoding="iso-8859-1"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";>

<xsd:element name="doc">
      <xsd:element name="entry1">
            <xsd:extension base="codelist">
              <xsd:attribute name="defattr" type="xsd:string" use="optional"
      <xsd:element name="entry2">
          <xsd:attribute name="attr" type="codelist"/>

<xsd:simpleType name="codelist">
  <xsd:restriction base="xsd:normalizedString">
    <xsd:enumeration value="AB"/>
    <xsd:enumeration value="CD"/>


V:\samp>msv defattr.wxd defattr.xml
No validation errors.

V:\samp>type copyofall2.xsl
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";

<xsl:template match="/">
  <xsl:copy-of select="."/>

V:\samp>xslt2 defattr.xml copyofall2.xsl con
<?xml version="1.0" encoding="UTF-8"?><doc xsi:noNamespaceSchemaLocation="defatt
r.wxd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
<entry2 attr="CD"/>

-- Next public European delivery: 3-day XSLT/2-day XSL-FO 2003-09-22 Instructor-led on-site corporate, government & user group training for XSLT and XSL-FO world-wide: please contact us for the details

G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
ISBN 0-13-065196-6                       Definitive XSLT and XPath
ISBN 0-13-140374-5                               Definitive XSL-FO
ISBN 1-894049-08-X   Practical Transformation Using XSLT and XPath
ISBN 1-894049-11-X               Practical Formatting Using XSL-FO
Member of the XML Guild of Practitioners:     http://XMLGuild.info
Male Breast Cancer Awareness  http://www.CraneSoftwrights.com/s/bc

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

Current Thread