所以我想distint-nodes在for子句中插入函数(参见下面的内容).我正在使用BaseX来达到这个目的.
这是我的代码:
<autores>{
for $a in doc("libros.xml")//libro
return
<autor>
<nombre>{
for $b in $a/autor
return concat($b/nombre,' ',$b/apellido)
}
</nombre>
{
for $c in doc("libros.xml")//libro
where $c/autor = $a/autor
return $c/titulo
}
</autor>
}
</autores>
Run Code Online (Sandbox Code Playgroud)
我想在第一个中使用这个函数,所以它只返回一个<autor/>元素的唯一实例:
for $b in distinct-nodes($a/autor)
return concat($b/nombre,' ',$b/apellido)
Run Code Online (Sandbox Code Playgroud)
但我收到以下错误(BaseX查询信息):
错误:停在G:/ Pruebas XML/XML/xqueryLibros.xq,6/31:[XPST0017]未知函数:fn:distinct-nodes.
为什么这个功能存在时是未知的?有什么我想念的吗?
编辑:我的目的是获取元素的唯一实例,$a/autor其中$a/autor/nombre和$a/autor/apellidos文本值相同
<autores>
<autor>
<nombre>W. Stevens</nombre>
<titulo>TCP/IP Ilustrado</titulo>
<titulo>Programación Avanzada en el entorno Unix</titulo>
</autor>
<autor>
<nombre>W. Stevens</nombre>
<titulo>TCP/IP Ilustrado</titulo>
<titulo>Programación …Run Code Online (Sandbox Code Playgroud) 在ABAP词典中,您几乎可以找到所有长度的“ CHAR”类型的数据元素,因此问题就来了:当您拥有一个可以承受所有长度的字符串元素时,它们具有什么功能?
我说的是那些具有特定长度但具有相同域类型的域。
在这里,我展示其中一些:
CHAR0001
CHAR0008
CHAR0010
CHAR0016
CHAR0032
CHAR004
CHAR005
CHAR006
CHAR0064
CHAR007
CHAR01
CHAR011
CHAR012
CHAR0128
CHAR02
CHAR022
CHAR0241
CHAR025
CHAR0256
CHAR03
CHAR04
CHAR05
CHAR060
CHAR07
CHAR08
CHAR101
CHAR102
CHAR1024
...
Run Code Online (Sandbox Code Playgroud)