XQuery XML help


by KataKoniK
Tags: xquery
KataKoniK
KataKoniK is offline
#1
Dec7-06, 01:12 PM
P: 168
I have to write an XQuery that for example, "returns a list of books for a given author".

The "given author" in this case can be anything. Therefore, I was wondering what do I need to add to give the query someting, which in return, it will process it.

For example,

for $x in doc("a.xml")/Stuff
where $x/Author = [given author]
return $x/Book
Phys.Org News Partner Science news on Phys.org
Simplicity is key to co-operative robots
Chemical vapor deposition used to grow atomic layer materials on top of each other
Earliest ancestor of land herbivores discovered
Sane
Sane is offline
#2
Dec11-06, 04:17 PM
P: 223
If the "given author" can be anything, that means it doesn't need to meet a certain condition in order to be processed, correct? And therefore, you shouldn't need to condition it with a "where" statement.

Merely process the Author attribute as you need it. What is it exactly that you are trying to do?


Register to reply