Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   XML (http://www.velocityreviews.com/forums/f32-xml.html)
-   -   XQUERY and particular search (http://www.velocityreviews.com/forums/t392760-xquery-and-particular-search.html)

thinkmarco@yahoo.it 01-24-2007 05:24 PM

XQUERY and particular search
 
Hi,
I have this doubt that I expose with an example.
I mark a lot of documents with the tag "city" and the attribute "nation".

for example

<xml>
...... bla bla bla
..... <CITY nation="England">London</CITY>
..... <CITY nation="USA">New York</CITY>
..... <CITY nation="France">Paris</CITY>
......
..... <CITY nation="Italy">Venice</CITY>
.....
</xml>

In a second moment I want add a second attribute, for example type="sea"
to indicate that the city is near to the sea. Some city could not have
this attribute

<xml>
...... bla bla bla
..... <CITY nation="England">London</CITY>
..... <CITY nation="USA" type="sea" >New York</CITY>
..... <CITY nation="France">Paris</CITY>
......
..... <CITY nation="Italy" type="sea" >Venice</CITY>
.....
</xml>

My question is: can I use XQuery (or xpath) to search directly all the
CITY where tha attribute "type" is not specified?

Thanks in advance
Marco Righi

Martin Honnen 01-24-2007 05:47 PM

Re: XQUERY and particular search
 
thinkmarco@yahoo.it wrote:

> My question is: can I use XQuery (or xpath) to search directly all the
> CITY where tha attribute "type" is not specified?


//CITY[not(@type))]


--

Martin Honnen
http://JavaScript.FAQTs.com/


All times are GMT. The time now is 12:45 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.