📄 xslt.xsd
字号:
<?xml version="1.0" ?><!--This free of charge Software is provided on an "AS IS" basis, withoutwarranty of any kind. The entire risk as to the quality and performance ofthe software is borne by you. Should the software prove defective, you andonly you assume the entire cost of any service and repair.WEBMETHODS DOES NOT MAKE ANY EXPRESS OR IMPLIED WARRANTIES OF ANY KINDINCLUDING, BUT NOT LIMITED TO, WARRANTIES OF TITLE, MERCHANTABILITY ORFITNESS FOR A PARTICULAR PURPOSE, OR WARRANTIES ARISING BY STATUTE, COURSEOF DEALING, CUSTOM OR USAGE, TRADE PRACTICE OR OTHERWISE.IN NO EVENT WILL WEBMETHODS BE LIABLE FOR ANY LOST REVENUES, PROFITS,BUSINESS OR INTERRUPTION OF BUSINESS OR OTHER SPECIAL, INDIRECT, INCIDENTALOR CONSEQUENTIAL DAMAGES, EVEN IF WEBMETHODS HAS BEEN ADVISED OF THEPOSSIBILITY OF SUCH DAMAGES, AND NOTWITHSTANDING ANY FAILURE OF ESSENTIALPURPOSE OF ANY LIMITED REMEDY OF ANY KIND, HOWEVER CAUSED AND UNDER ANYTHEORY OF LIABILITY.Schema for XSLT 1.0 Recommendation, http://www.w3.org/TR/1999/REC-xslt-19991116Using XML Schema CR Drafts, - Part 1, http://www.w3.org/TR/2000/CR-xmlschema-1-20001024/- Part 2, http://www.w3.org/TR/2000/CR-xmlschema-2-20001024/Author: Asir S VedamuthuMember, XML Schema WG representing webMethods, Inc.Member, XML Schema Processor design and implementation team at webMethodswebMethods, Inc.3930 Pender DriveFairfax VA 22030(703) 450-2500Date - February 28th, 2001Version - 0.4This work is a product of the W3C XML Schema WG Task Force for authoring schema for W3C Recommendations as an illustration of the XML Schema Language. This schemais illustrative and non-normative. Internal names created by this schema follows thesame convention used by XSLT 1.0 specification.Comments were stolen from the XSLT 1.0 specification, http://www.w3.org/TR/1999/REC-xslt-19991116#element-syntax-summaryAsir intends to update this schema as the XML Schema drafts advance from CR to PR and then REC. Expected changes are,[1] XML Schema Namespace URI[2] Change attribute declaration syntaxKNOWN ISSUES,(a) XML Schema Definition Language cannot capture a unique wild card expression in XSLT:"In addition, the xsl:stylesheet element may contain any element not from the XSLT namespace,provided that the expanded-name of the element has a non-null namespace URI" -http://www.w3.org/TR/1999/REC-xslt-19991116#stylesheet-element (This will not be an issue as per XML Schema PR)Revision History0.1 - Created0.2 - Fixed minor typos0.3 - Implemented suggestions and added fragments from James Clark0.4 - Fixed a minor typoAcknowledgementThe following have contributed material to this draft:- James Clark, jjc@jclark.comPlease send your comments and suggestions to asirv@webmethods.com--><schema xmlns="http://www.w3.org/2000/10/XMLSchema" targetNamespace="http://www.w3.org/1999/XSL/Transform" elementFormDefault="qualified" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xpath="http://www.w3.org/TR/2001/WD-xptr-20010108/" blockDefault="#all"> <import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2000/10/xml.xsd"/> <!-- *** import schema for xpath authored by C. M. Sperberg-McQueen [cmsmcq@acm.org] Chair, XML Schema WG <import namespace="http://www.w3.org/TR/2001/WD-xptr-20010108/" schemaLocation="xpath.xsd"/> --> <!-- *** result elements *** --> <!-- *** *** --> <!-- There are three ways that you can construct a schema for XSLT stylesheets that create instances of a particular result structure (a) Declare all your result elements as a member of xsl:result-element substitution group (b) Redefine model group xsl:result-element to accomodate the desired structure (c) Do nothing. This schema is designed to allow any element node or nodes if they have any namespace other than the XSLT namespace or not namespace qualified I recommend (a) or (b) In addition, I added a an attributeGroup util, 'result-element' for your convenience --> <element name="result-element" abstract="true" type="anyType"/> <attributeGroup name="result-element"> <attribute name="extension-element-prefixes" form="qualified" type="string"/> <attribute name="exclude-result-prefixes" form="qualified" type="string"/> <attribute name="use-attribute-sets" form="qualified" type="xsl:QNames"/> <attribute name="version" form="qualified" type="NMTOKEN"/> <anyAttribute namespace="##other" processContents="skip"/> </attributeGroup> <group name="result-element"> <choice> <element ref="xsl:result-element"/> <any namespace="##other" processContents="skip"/> </choice> </group> <!-- *** Style Sheet Elements *** --> <!-- *** *** --> <element name="stylesheet" type="xsl:wrapper"/> <element name="transform" type="xsl:wrapper"/> <complexType name="wrapper"> <complexContent> <extension base="xsl:anyType"> <sequence> <element ref="xsl:import" minOccurs="0" maxOccurs="unbounded"/> <choice minOccurs="0" maxOccurs="unbounded"> <element ref="xsl:top-level-element"/> <element ref="xsl:variable"/> <any namespace="##other" processContents="skip"/> <!-- weaker than XSLT 1.0 --> </choice> </sequence> <attribute name="id" type="ID"/> <attribute name="extension-element-prefixes" type="xsl:tokens"/> <attribute name="exclude-result-prefixes" type="xsl:tokens"/> <attribute name="version" type="decimal" use="required"/> <attribute ref="xml:space"/> </extension> </complexContent> </complexType> <!-- *** top level elements *** --> <!-- *** *** --> <element name="top-level-element" type="xsl:anyType" abstract="true"/> <element name="top-level-element-and-char-instruction" type="xsl:anyType" abstract="true"/> <element name="attribute-set" substitutionGroup="xsl:top-level-element"> <!-- *** <xsl:attribute-set name = qname use-attribute-sets = qnames> Content: xsl:attribute* </xsl:attribute-set> --> <complexType> <complexContent> <extension base="xsl:anyType"> <sequence minOccurs="0" maxOccurs="unbounded"> <element ref="xsl:attribute"/> </sequence> <attributeGroup ref="xsl:name"/> <attributeGroup ref="xsl:use-attribute-sets"/> <attribute ref="xml:space"/> </extension> </complexContent> </complexType> </element> <element name="decimal-format" substitutionGroup="xsl:top-level-element"> <!-- *** <xsl:decimal-format name = qname decimal-separator = char grouping-separator = char infinity = string minus-sign = char NaN = string percent = char per-mille = char zero-digit = char digit = char pattern-separator = char /> --> <complexType> <complexContent> <extension base="xsl:anyType"> <attribute name="name" type="xsl:QName"/> <attribute name="decimal-separator" type="string" use="default" value="."/> <attribute name="grouping-separator" type="string" use="default" value=","/> <attribute name="infinity" type="string" use="default" value="Infinity"/> <attribute name="minus-sign" type="string" use="default" value="-"/> <attribute name="NaN" type="string" use="default" value="NaN"/> <attribute name="percent" type="string" use="default" value="%"/> <attribute name="per-mille" type="string" use="default" value="‰"/> <attribute name="zero-digit" type="string" use="default" value="0"/> <attribute name="digit" type="string" use="default" value="#"/> <attribute name="pattern-separator" type="string" use="default" value=";"/> </extension> </complexContent> </complexType> </element> <element name="include" substitutionGroup="xsl:top-level-element" type="xsl:combine-stylesheets"> <!-- *** <xsl:include href = uri-reference /> --> </element> <element name="key" substitutionGroup="xsl:top-level-element"> <!-- *** <xsl:key name = qname match = pattern use = expression /> --> <complexType> <complexContent> <extension base="xsl:anyType"> <attributeGroup ref="xsl:name"/> <attribute name="match" type="xsl:pattern" use="required"/> <attribute name="use" type="xsl:expression" use="required"/> </extension> </complexContent> </complexType> </element> <element name="namespace-alias" substitutionGroup="xsl:top-level-element"> <!-- *** --> <complexType> <complexContent> <extension base="xsl:anyType"> <attribute name="stylesheet-prefix" type="xsl:prefix" use="required"/> <attribute name="result-prefix" type="xsl:prefix" use="required"/> </extension> </complexContent> </complexType> </element> <element name="output" substitutionGroup="xsl:top-level-element"> <!-- *** <xsl:output method = "xml" | "html" | "text" | qname-but-not-ncname version = nmtoken encoding = string omit-xml-declaration = "yes" | "no" standalone = "yes" | "no" doctype-public = string doctype-system = string cdata-section-elements = qnames indent = "yes" | "no" media-type = string /> --> <complexType> <complexContent> <extension base="xsl:anyType"> <attribute name="method"> <simpleType> <union> <simpleType> <restriction base="string"> <enumeration value="xml"/> <enumeration value="html"/> <enumeration value="text"/> </restriction> </simpleType> <simpleType> <restriction base="xsl:QName"> <pattern value="\c*:\c*"/> </restriction> </simpleType> </union> </simpleType> </attribute> <attribute name="version" type="NMTOKEN"/> <attribute name="encoding" type="string"/> <attribute name="omit-xml-declaration" type="xsl:YesOrNo"/> <attribute name="standalone" type="xsl:YesOrNo"/> <attribute name="doctype-public" type="string"/> <attribute name="doctype-system" type="string"/> <attribute name="cdata-section-elements" type="xsl:QNames"/> <attribute name="indent" type="xsl:YesOrNo"/> <attribute name="media-type" type="string"/> </extension> </complexContent> </complexType> </element> <element name="param" substitutionGroup="xsl:top-level-element" type="xsl:variable"> <!-- *** <xsl:param name = qname select = expression> Content: template </xsl:param> --> </element> <element name="preserve-space" substitutionGroup="xsl:top-level-element"> <!-- *** <xsl:preserve-space elements = tokens /> --> <complexType> <complexContent> <extension base="xsl:anyType"> <attribute name="elements" type="xsl:element-names" use="required"/> </extension> </complexContent> </complexType> </element> <element name="strip-space" substitutionGroup="xsl:preserve-space"/> <element name="template" substitutionGroup="xsl:top-level-element"> <!-- *** <xsl:template match = pattern name = qname priority = number mode = qname> Content: (xsl:param*, template) </xsl:template> --> <complexType mixed="true"> <complexContent> <extension base="xsl:anyType"> <sequence> <element ref="xsl:param" minOccurs="0" maxOccurs="unbounded"/> <choice minOccurs="0" maxOccurs="unbounded"> <element ref="xsl:top-level-element-and-char-instruction"/> <element ref="xsl:instruction"/> <group ref="xsl:result-element"/> </choice> </sequence> <attribute name="match" type="xsl:pattern"/> <attribute name="name" type="xsl:QName"/> <attribute name="priority" type="decimal"/> <attribute name="mode" type="xsl:QName"/> <attribute ref="xml:space"/> </extension> </complexContent> </complexType> </element> <!-- *** top level elements and char instructions *** --> <!-- *** *** --> <element name="variable" type="xsl:variable" substitutionGroup="xsl:char-instruction"> <!-- *** <xsl:variable name = qname select = expression> Content: template </xsl:variable> --> </element> <!-- *** instructions *** --> <!-- *** *** --> <element name="instruction" type="xsl:anyType" abstract="true"/> <element name="char-instruction" type="xsl:anyType" abstract="true" substitutionGroup="xsl:instruction"/> <element name="apply-imports" type="xsl:anyType" substitutionGroup="xsl:char-instruction"> <!-- *** <xsl:apply-imports /> --> </element> <element name="apply-templates" substitutionGroup="xsl:char-instruction"> <!-- *** <xsl:apply-templates select = node-set-expression mode = qname> Content: (xsl:sort | xsl:with-param)* </xsl:apply-templates> --> <complexType> <complexContent> <extension base="xsl:anyType"> <choice minOccurs="0" maxOccurs="unbounded"> <element ref="xsl:sort"/> <element ref="xsl:with-param"/> </choice> <attribute name="select" type="xsl:expression" use="default" value="node()"/> <attribute name="mode" type="xsl:QName"/> </extension> </complexContent> </complexType> </element> <element name="attribute" type="xsl:attribute-type" substitutionGroup="xsl:instruction"/> <element name="call-template" substitutionGroup="xsl:char-instruction"> <!-- *** <xsl:call-template name = qname> Content: xsl:with-param* </xsl:call-template> --> <complexType> <complexContent> <extension base="xsl:anyType"> <sequence minOccurs="0" maxOccurs="unbounded"> <element ref="xsl:with-param"/> </sequence> <attributeGroup ref="xsl:name"/> </extension> </complexContent> </complexType> </element> <element name="choose" substitutionGroup="xsl:char-instruction"> <!-- *** <xsl:choose> Content: (xsl:when+, xsl:otherwise?) </xsl:choose> --> <complexType> <complexContent> <extension base="xsl:anyType"> <sequence> <element ref="xsl:when" minOccurs="1" maxOccurs="unbounded"/> <element ref="xsl:otherwise" minOccurs="0"/> </sequence> <attribute ref="xml:space"/> </extension> </complexContent> </complexType> </element> <element name="comment" substitutionGroup="xsl:instruction"> <!-- *** <xsl:comment> Content: template </xsl:comment>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -