Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1485 Add xsl:record-type declaration #1708

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions specifications/xquery-40/src/expressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5681,8 +5681,10 @@ name.</p>

<p>The equivalent in XSLT is:</p>

<eg><![CDATA[<xsl:item-type name="my:list"
as="record(value as item()*, next? as my:list)"/>]]></eg>
<eg><![CDATA[<xsl:record-type name="my:list">
<xsl:field name="value" as="item()*"/>
<xsl:field name="next" as="my:list" required="no"/>
</xsl:record-type>]]></eg>



Expand Down
52 changes: 46 additions & 6 deletions specifications/xslt-40/src/element-catalog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
<e:constant value="variable"/>
<e:constant value="mode"/>
<e:constant value="item-type"/>
<e:constant value="record-type"/>
<e:constant value="*"/>
</e:attribute>
<e:attribute name="names" required="yes">
Expand All @@ -121,6 +122,7 @@
<e:constant value="variable"/>
<e:constant value="mode"/>
<e:constant value="item-type"/>
<e:constant value="record-type"/>
<e:constant value="*"/>
</e:attribute>
<e:attribute name="names" required="yes">
Expand Down Expand Up @@ -840,12 +842,12 @@
<e:attribute name="name" required="yes">
<e:data-type name="eqname"/>
</e:attribute>
<e:attribute name="as">
<e:attribute name="as" default="'item()*'">
<e:data-type name="item-type"/>
</e:attribute>
<e:attribute name="visibility">
<e:attribute name="visibility" default="'private'">
<e:constant value="private"/>
<e:constant value="final"/>
<e:constant value="public"/>
</e:attribute>
<e:empty/>
<e:allowed-parents>
Expand All @@ -854,6 +856,47 @@
<e:parent name="transform"/>
</e:allowed-parents>
</e:element-syntax>

<e:element-syntax name="record-type">
<e:in-category name="declaration"/>
<e:attribute name="name" required="yes">
<e:data-type name="eqname"/>
</e:attribute>
<e:attribute name="extensible" default="'no'">
<e:data-type name="boolean"/>
</e:attribute>
<e:attribute name="visibility" default="'private'">
<e:constant value="private"/>
<e:constant value="public"/>
</e:attribute>
<e:sequence>
<e:element repeat="zero-or-more" name="field"/>
</e:sequence>
<e:allowed-parents>
<e:parent name="package"/>
<e:parent name="stylesheet"/>
<e:parent name="transform"/>
</e:allowed-parents>
</e:element-syntax>

<e:element-syntax name="field">
<e:attribute name="name" required="yes">
<e:data-type name="NCName"/>
</e:attribute>
<e:attribute name="as" default="'item()*'">
<e:data-type name="sequence-type"/>
</e:attribute>
<e:attribute name="required" default="'yes'">
<e:data-type name="boolean"/>
</e:attribute>
<e:attribute name="default">
<e:data-type name="expression"/>
</e:attribute>
<e:empty/>
<e:allowed-parents>
<e:parent name="record-type"/>
</e:allowed-parents>
</e:element-syntax>

<e:element-syntax name="function">
<e:in-category name="declaration"/>
Expand Down Expand Up @@ -897,9 +940,6 @@
<e:attribute name="cache" required="no" default="'no'">
<e:data-type name="boolean"/>
</e:attribute>
<e:attribute name="variadic" required="no" default="'no'">
<e:data-type name="boolean"/>
</e:attribute>
<e:sequence>
<e:element repeat="zero-or-more" name="param"/>
<e:model name="sequence-constructor"/>
Expand Down
2 changes: 0 additions & 2 deletions specifications/xslt-40/src/schema-for-xslt40.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,6 @@ of problems processing the schema using various tools
<xs:attribute name="override-extension-function" type="xsl:yes-or-no"/>
<xs:attribute name="new-each-time" type="xsl:yes-or-no-or-maybe"/>
<xs:attribute name="cache" type="xsl:yes-or-no"/>
<xs:attribute name="variadic" type="xsl:yes-or-no"/>
<xs:attribute name="_name" type="xs:string"/>
<xs:attribute name="_override" type="xs:string"/>
<xs:attribute name="_as" type="xs:string"/>
Expand All @@ -981,7 +980,6 @@ of problems processing the schema using various tools
<xs:attribute name="_override-extension-function" type="xs:string"/>
<xs:attribute name="_new-each-time" type="xs:string"/>
<xs:attribute name="_cache" type="xs:string"/>
<xs:attribute name="_variadic" type="xs:string"/>
<xs:assert test="exists(@name | @_name)"/>
<xs:assert test="every $e in xsl:param satisfies empty($e/(@visibility | @_visibility))">
<xs:annotation>
Expand Down
Loading
Loading