Skip to content

Commit

Permalink
Merge pull request qt4cg#470 from michaelhkay/Issue369-namespaces-for…
Browse files Browse the repository at this point in the history
…-functions

369: add fixed-prefixes attribute in XSLT
  • Loading branch information
ndw authored Nov 29, 2023
2 parents 3711b2d + b49a914 commit 544383a
Show file tree
Hide file tree
Showing 4 changed files with 425 additions and 83 deletions.
1 change: 1 addition & 0 deletions specifications/xquery-40/src/expressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7718,6 +7718,7 @@ escaping may be needed.</p>
/>. In general, the name of a constructor function for a given type is the same as the name of the type (including its namespace). For
example:</p>


<ulist>


Expand Down
21 changes: 15 additions & 6 deletions specifications/xslt-40/src/element-catalog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@
<e:attribute name="expand-text" required="no" default="'no'">
<e:data-type name="boolean"/>
</e:attribute>
<e:attribute name="use-when" required="no" default="true()">
<e:attribute name="fixed-namespaces" required="no">
<e:data-type name="string"/>
</e:attribute>
<e:attribute name="use-when" required="no">
<e:data-type name="expression"/>
</e:attribute>
<e:attribute name="xpath-default-namespace" required="no">
Expand Down Expand Up @@ -182,7 +185,10 @@
<e:attribute name="expand-text">
<e:data-type name="boolean"/>
</e:attribute>
<e:attribute name="main-module">
<e:attribute name="fixed-namespaces" required="no">
<e:data-type name="string"/>
</e:attribute>
<e:attribute name="main-module" required="no">
<e:data-type name="uri"/>
</e:attribute>
<e:attribute name="use-when" default="true()">
Expand Down Expand Up @@ -228,6 +234,9 @@
<e:attribute name="expand-text" default="'no'">
<e:data-type name="boolean"/>
</e:attribute>
<e:attribute name="fixed-namespaces">
<e:data-type name="string"/>
</e:attribute>
<e:attribute name="main-module">
<e:data-type name="uri"/>
</e:attribute>
Expand Down Expand Up @@ -284,7 +293,7 @@
</e:allowed-parents>
</e:element-syntax>

<e:element-syntax name="function-library">
<!--<e:element-syntax name="function-library">
<e:in-category name="declaration"/>
<e:attribute name="namespace">
<e:data-type name="uri"/>
Expand All @@ -298,9 +307,9 @@
<e:parent name="stylesheet"/>
<e:parent name="transform"/>
</e:allowed-parents>
</e:element-syntax>
</e:element-syntax>-->

<e:element-syntax name="function-namespace">
<!--<e:element-syntax name="function-namespace">
<e:attribute name="uri" required="yes">
<e:data-type name="uri"/>
</e:attribute>
Expand All @@ -314,7 +323,7 @@
<e:allowed-parents>
<e:parent name="function-library"/>
</e:allowed-parents>
</e:element-syntax>
</e:element-syntax>-->

<!-- Data Model -->

Expand Down
38 changes: 38 additions & 0 deletions specifications/xslt-40/src/schema-for-xslt40.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -1521,11 +1521,13 @@ of problems processing the schema using various tools
<xs:attribute name="name" type="xs:anyURI"/>
<xs:attribute name="package-version" type="xs:string"/>
<xs:attribute name="input-type-annotations" type="xsl:input-type-annotations-type"/>
<xs:attribute name="fixed-namespaces" type="xsl:fixed-namespaces-type"/>
<xs:attribute name="_declared-modes" type="xs:string"/>
<xs:attribute name="_id" type="xs:string"/>
<xs:attribute name="_name" type="xs:string"/>
<xs:attribute name="_package-version" type="xs:string"/>
<xs:attribute name="_input-type-annotations" type="xs:string"/>
<xs:attribute name="_fixed-namespaces" type="xs:string"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
Expand Down Expand Up @@ -1930,8 +1932,11 @@ of problems processing the schema using various tools
<xs:attribute name="input-type-annotations"
type="xsl:input-type-annotations-type"
default="unspecified"/>
<xs:attribute name="fixed-namespaces"
type="xsl:fixed-namespaces-type"/>
<xs:attribute name="_id" type="xs:string"/>
<xs:attribute name="_input-type-annotations" type="xs:string"/>
<xs:attribute name="_fixed-namespaces" type="xs:string"/>
<!--* The 'static' attribute may be used on 'param' and 'variable'
* only when they are top-level elements. *-->
<xs:assert test="every $v in (.//xsl:param, .//xsl:variable)[exists(@static | @_static)]
Expand Down Expand Up @@ -2298,6 +2303,39 @@ of problems processing the schema using various tools
<xs:pattern value=".+"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="fixed-namespaces-type">
<xs:annotation>
<xs:documentation>
<p>
A sequence of tokens, each of which may be one of #default, an NCName, a prefix=namespace binding, or a URI
</p>
</xs:documentation>
</xs:annotation>
<xs:list>
<xs:simpleType>
<xs:union>
<!-- Option 1: #default -->
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="#default"/>
</xs:restriction>
</xs:simpleType>
<!-- Option 2: NCName -->
<xs:simpleType ref="xs:NCName"/>
<!-- Option 3: prefix=namespace -->
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="([\i-[:]][\c-[:]]*:)=.+"/>
</xs:restriction>
</xs:simpleType>
<!-- Option 4: anyURI -->
<xs:simpleType ref="xs:anyURI"/>
</xs:union>
</xs:simpleType>
</xs:list>

</xs:simpleType>

<xs:simpleType name="item-type">
<xs:annotation>
Expand Down
Loading

0 comments on commit 544383a

Please sign in to comment.