Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有下一个DTD定义
DTD
<!ELEMENT testNode EMPTY> <!ATTLIST testNode listOfNodes IDREFS #REQUIRED bestNode IDREF #REQUIRED >
当我得到时,我必须检查listOfNodes/testNode/@listOfNodes中是否有多个 ref 。我怎样才能做到这一点 ?
/testNode/@listOfNodes
如果属性 listOfNodes 中有多个 IDREF 值,则必须按照 DTD 规则用空格分隔。因此,您可以按照此示例检查多个值:
let $x := <testNode listOfNodes="d1 d2"/> return if(contains($x/@listOfNodes, ' ')) then "Yes" else "No"
对于多个值,它将返回“是”,否则返回“否”