문제

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.

도움이 되었습니까?

해결책

Use just:

//title[not(@xml:lang)]

다른 팁

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top