This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 8399 - inline schema example still has errors
Summary: inline schema example still has errors
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 2.0 (show other bugs)
Version: Recommendation
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL: http://www.w3.org/XML/2007/qt-errata/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-29 15:58 UTC by Martin Honnen
Modified: 2010-07-20 09:54 UTC (History)
1 user (show)

See Also:


Attachments

Description Martin Honnen 2009-11-29 15:58:56 UTC
The errata http://www.w3.org/XML/2007/qt-errata/xslt-errata.html#E28 corrects the inline schema example to

<xsl:import-schema>
  <xs:schema targetNamespace="http://localhost/ns/yes-no"
             xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:simpleType name="local:yes-no">
      <xs:restriction base="xs:string">
        <xs:enumeration value="yes"/>
        <xs:enumeration value="no"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:schema>
</xsl:import-schema>

<xs:variable name="condition" select="local:yes-no('yes')" as="local:yes-no"/>

That still has two errors in my understanding, the obvious is that the variable declaration needs to use xsl:variable, not xs:variable, and in my understanding the type needs to be defined as
  <xs:simpleType name="yes-no">
without a prefix, as http://www.w3.org/TR/xmlschema-1/#declare-datatype defines the name as an NCName, not as a QName.
Comment 1 Michael Kay 2009-11-30 11:39:52 UTC
You are quite correct.

For the F+O spec I have added automated testing of examples to the build process for the spec. It's trickier to do for the XSLT spec because the examples are usually fragments, but there would clearly be value in doing it.

Comment 2 Sharon Adler 2010-05-25 21:16:53 UTC
At the 20 May 2010 the XSLT WG accepted the correction and decided to issue an erratum.

We will also explore using automated checking.
Comment 3 Michael Kay 2010-07-15 09:22:00 UTC
Decided to apply this change to the PER text of the spec so that it will be corrected in the second edition.
Comment 4 Michael Kay 2010-07-20 09:54:41 UTC
Committed this change (to xsl-query-specs/xslt/ed2/xslt20.xml)