node.xsl (n:attr#1): added
parent
057cdbb683
commit
2967463cdb
10
src/node.xsl
10
src/node.xsl
|
@ -156,6 +156,16 @@
|
||||||
</function>
|
</function>
|
||||||
|
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Construct an attribute named @var{qname} with an empty value.
|
||||||
|
-->
|
||||||
|
<function name="n:attr" as="attribute()">
|
||||||
|
<param name="qname" as="xs:QName" />
|
||||||
|
|
||||||
|
<sequence select="n:attr( $qname, '' )" />
|
||||||
|
</function>
|
||||||
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Create a text node with the given @var{text}. The @var{text} will be
|
Create a text node with the given @var{text}. The @var{text} will be
|
||||||
output verbatim without any whitespace processing.
|
output verbatim without any whitespace processing.
|
||||||
|
|
|
@ -172,12 +172,12 @@
|
||||||
|
|
||||||
|
|
||||||
<scenario label="A new attribute">
|
<scenario label="A new attribute">
|
||||||
|
<scenario label="with a value">
|
||||||
<!-- to test this, the attribute needs an element parent -->
|
<!-- to test this, the attribute needs an element parent -->
|
||||||
<call function="n:element">
|
<call function="n:element">
|
||||||
<param name="qname" select="$test-qname-a" />
|
<param name="qname" select="$test-qname-a" />
|
||||||
<param name="attrs"
|
<param name="attrs"
|
||||||
select="n:attr( $test-qname-b, 'foo' )" />
|
select="n:attr( $test-qname-b, 'foo' )" />
|
||||||
<param name="child-nodes" select="()" />
|
|
||||||
</call>
|
</call>
|
||||||
|
|
||||||
<expect label="has given QName"
|
<expect label="has given QName"
|
||||||
|
@ -188,6 +188,23 @@
|
||||||
</scenario>
|
</scenario>
|
||||||
|
|
||||||
|
|
||||||
|
<scenario label="with no value">
|
||||||
|
<!-- to test this, the attribute needs an element parent -->
|
||||||
|
<call function="n:element">
|
||||||
|
<param name="qname" select="$test-qname-a" />
|
||||||
|
<param name="attrs"
|
||||||
|
select="n:attr( $test-qname-c )" />
|
||||||
|
</call>
|
||||||
|
|
||||||
|
<expect label="has given QName"
|
||||||
|
test="node-name( $x:result/@* ) = $test-qname-c" />
|
||||||
|
|
||||||
|
<expect label="has empty value"
|
||||||
|
test="$x:result/@* = ''" />
|
||||||
|
</scenario>
|
||||||
|
</scenario>
|
||||||
|
|
||||||
|
|
||||||
<scenario label="A new text node">
|
<scenario label="A new text node">
|
||||||
<scenario label="standalone">
|
<scenario label="standalone">
|
||||||
<call function="n:text">
|
<call function="n:text">
|
||||||
|
|
Loading…
Reference in New Issue