Anonymous records added
* src/record.xsl (R:make-record-header#1): added * test/record.xspec: R:make-record-header#1 scenario addedmaster
parent
ae98699094
commit
7196a2f0c6
|
@ -249,6 +249,19 @@
|
|||
select="QName( $R:ns, 'R:Record' )" />
|
||||
|
||||
|
||||
<!--
|
||||
Make a new anonymous record header containing @var{slots} slots.
|
||||
|
||||
Usually, you want a record to be named,
|
||||
but anonymous records might be useful for temporary or grouped data.
|
||||
-->
|
||||
<function name="R:make-record-header" as="element( R:Record )">
|
||||
<param name="slots" as="xs:integer" />
|
||||
|
||||
<sequence select="R:make-record-header( $R:qname, $slots, () )" />
|
||||
</function>
|
||||
|
||||
|
||||
<!--
|
||||
Make a new record header for a record identified by @var{qname} containing
|
||||
@var{slots} slots.
|
||||
|
|
|
@ -51,6 +51,25 @@
|
|||
select="QName( $slot-ns, 'd' )" />
|
||||
|
||||
<scenario label="R:make-record-header">
|
||||
<scenario label="with no name">
|
||||
<call function="R:make-record-header">
|
||||
<param name="slots" select="3" />
|
||||
</call>
|
||||
|
||||
<expect label="produces an R:Record element"
|
||||
test="$x:result instance of element( R:Record )" />
|
||||
|
||||
<expect label="R:Record type matches the generic R:Record"
|
||||
test="R:is-a( $R:qname, $x:result )" />
|
||||
|
||||
<expect label="R:Record type does not match other QName"
|
||||
test="not( R:is-a( $test-qname-2, $x:result ) )" />
|
||||
|
||||
<expect label="R:Record element contains number of slots"
|
||||
test="R:slot-count( $x:result ) = 3" />
|
||||
</scenario>
|
||||
|
||||
|
||||
<scenario label="with no supertype">
|
||||
<call function="R:make-record-header">
|
||||
<param name="qname" select="$test-qname" />
|
||||
|
|
Loading…
Reference in New Issue