XML/XQuery/not

Материал из Web эксперт
Перейти к: навигация, поиск

Combining the not function with a quantified expression

   <source lang="xml">

File: Data.xml

<order>

 <car model="A">
   <id>0001</id>
 </car>
 <car model="B">
   <id>0002</id>
 </car>
 <car model="B">
   <id>0003</id>
 </car>
 <car model="C">
   <id>0004</id>
 </car>

</order>

File: Query.xquery not(some $model in doc("Data.xml")//car/@model

   satisfies ($model = "B"))

Output: <?xml version="1.0" encoding="UTF-8"?>false

</source>