gpt4 book ai didi

xml - XPath查询问题

转载 作者:行者123 更新时间:2023-12-03 17:12:44 25 4
gpt4 key购买 nike

我的XML DTD如下:

<!DOCTYPE Bookstore [
<!ELEMENT Bookstore (Book | Magazine)*>
<!ELEMENT Book (Title, Authors, Remark?)>
<!ATTLIST Book ISBN CDATA #REQUIRED
Price CDATA #REQUIRED
Edition CDATA #REQUIRED>
<!ELEMENT Magazine (Title)>
<!ATTLIST Magazine Month CDATA #REQUIRED Year CDATA #REQUIRED>
<!ELEMENT Title (#PCDATA)>
<!ELEMENT Authors (Author+)>
<!ELEMENT Remark (#PCDATA)>
<!ELEMENT Author (First_Name, Last_Name)>
<!ELEMENT First_Name (#PCDATA)>
<!ELEMENT Last_Name (#PCDATA)>
]>


我想运行以下查询:

Title Book whose title is the same as title of a magazine.


我想不出一种方法来运行此query.Anyone请帮助我,我将感激不尽。

最佳答案

您可以尝试这样的事情:

//Bookstore/Book/Title[. = //Magazine/Title]


在xpath之上,返回所有 <Title>元素,这些元素是 <Book>的子元素,并且其值至少等于 <Title>的一个 <Magazine>

关于xml - XPath查询问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30555589/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com