XPATH删除元素串联中的额外空格
在XPATH中,我处理的是如下所示的源XML,其中我希望用空格分隔符连接每个XPATH删除元素串联中的额外空格,xpath,Xpath,在XPATH中,我处理的是如下所示的源XML,其中我希望用空格分隔符连接每个编辑器的子元素以创建全名,然后依次用逗号连接生成的全名: <biblStruct type="book" xml:id="Biller_2011a"> <monogr> <title>Inquisitors and Heretics in Thirteenth-Century Languedoc: Edition and Translation
编辑器的子元素以创建全名,然后依次用逗号连接生成的全名:
<biblStruct type="book" xml:id="Biller_2011a">
<monogr>
<title>Inquisitors and Heretics in Thirteenth-Century Languedoc: Edition and Translation
of Toulouse Inquisition Depositions, 1273-1282</title>
<editor>
<forename>Peter</forename><surname>Biller</surname>
</editor>
<editor>
<forename>Caterina</forename><surname>Bruschi</surname>
</editor>
<editor>
<forename>Shelagh</forename><surname>Sneddon</surname>
</editor>
<imprint>
<pubPlace>
<settlement>Leiden</settlement>
<country>NL</country>
</pubPlace>
<publisher>Brill</publisher>
<date type="pub_date">2011</date>
</imprint>
</monogr>
</biblStruct>
但这会在逗号前后输出额外的空间:
<editors>Peter Biller , Caterina Bruschi , Shelagh Sneddon</editors>
Peter Biller、Caterina Bruschi、Shelagh Sneddon
相反,我想输出:
<editors>Peter Biller, Caterina Bruschi, Shelagh Sneddon</editors>
Peter Biller、Caterina Bruschi、Shelagh Sneddon
提前感谢。“我想连接每个编辑器的子元素的地方,
”将转换为$auth/*
,而不是$auth//child::text()
不知何故,返回的和的整个组合
和string-join
看起来很奇怪,似乎您可以直接使用string-join($bibref//tei:editor/string-join(*,“”),“,”)
Rats,这是一个打字错误,我的意思是XPATH而不是XSLT。更新了问题,并不是因为它改变了你的答案。
<editors>Peter Biller, Caterina Bruschi, Shelagh Sneddon</editors>