来自xml文件的xquery retreive数据 [英] xquery retreive data from xml file

查看:76
本文介绍了来自xml文件的xquery retreive数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I would like to find all libraries with same number of books availbles and as many as empty shelves as the library called "Oxford".

    <librarycollections>
    <library>
    <id>1</id>
    <library_name> oxford <library_name>
    <name>DBMS</name>
    <availble_books>2</availble_books>
    <empty_shelves>5</empty_shelves>
    </library>

    for $x in doc("filename.xml")/librarycollections/library/
        where $x/@available_books = available_books and $x/empty_shelves ="oxford"
        retunrn...

The result I'm trying to get is like this :
Empty shelves/number of books/ library name

    <li>2 empty, 8 bookes @ Greenwich library </li>
    <li>5 empty, 8 bookes @ UCL library </li>

Appreciate any help.
Thank you

推荐答案

x在doc(filename.xml)/ librarycollections / library /
其中
x in doc("filename.xml")/librarycollections/library/ where


x / @ available_books = available_books和
x/@available_books = available_books and


x / empty_shelves =oxford
retunrn ...

我想要得到的结果是这样的:
空架子/书籍数量/图书馆名称

< li > 2空,8位预订@ Greenwich library < / li >
< li > 5空,8个预订@UCL库< / li >

感谢任何帮助。
谢谢
x/empty_shelves ="oxford" retunrn... The result I'm trying to get is like this : Empty shelves/number of books/ library name <li>2 empty, 8 bookes @ Greenwich library </li> <li>5 empty, 8 bookes @ UCL library </li> Appreciate any help. Thank you


这篇关于来自xml文件的xquery retreive数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆