1

The creator of an XML document that I'm running XQuery commands on left the lang attribute out of titles in titled sales materials (books, records, CD's, etc.) that are in English, making it difficult to locate English titles. I'm looking for a way to locate results that do not contain an xml:lang attribute.

CharlesB
  • 86,532
  • 28
  • 194
  • 218
Wolfpack'08
  • 3,982
  • 11
  • 46
  • 78

2 Answers2

3

Use just:

//title[not(@xml:lang)]
Dimitre Novatchev
  • 240,661
  • 26
  • 293
  • 431
-1

Add a where clause containing the not() function, to limit your results:

for $resulta in doc("test")//catalog/item/title
where $resulta[not(@xml:lang)] (: this line :)
return $resulta
Wolfpack'08
  • 3,982
  • 11
  • 46
  • 78