XQUERY and particular search

T

thinkmarco

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top