functx:all-whitespace
Se um valor é só espaço em branco ou uma string vazia
Descrição
A função functx:all-whitespace testa se uma string (ou um nó, que é atomizado) é só espaço em branco ou está vazia. Se $arg for a sequência vazia, devolve true.
Parâmetros |
Descrição |
|---|---|
arg:string() |
a string (ou o nó) a testar |
Exemplos
Os exemplos abaixo usam este documento de entrada:
<xsl:variable name="in-xml" as="item()*">
<in-xml>
<a> </a>
<b>x </b>
<c> <x>x</x> </c>
</in-xml>
</xsl:variable>
XPath |
Resultado |
|---|---|
functx:all-whitespace(' ') |
true |
functx:all-whitespace(' x ') |
false |
functx:all-whitespace($in-xml/a) |
true |
functx:all-whitespace($in-xml/b) |
false |
functx:all-whitespace($in-xml/c) |
false |
functx:all-whitespace($in-xml/c/text()[1]) |
true |