-2
我需要返回所有的书只有疗法是没有书的14.95的价格....XPATH找到一个节点,如果没有其他节点具有sertin值
的DTD
<!ELEMENT inventory (book)+>
<!ELEMENT book (title, author+, publisher+, price, chapter*)>
<!ATTLIST book num ID #REQUIRED>
<!ELEMENT chapter (title, (paragraph* | section*))>
<!ELEMENT section (title?, paragraph*)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT author (#PCDATA)>
<!ELEMENT publisher (#PCDATA)>
<!ELEMENT price (#PCDATA)>
<!ATTLIST price currency CDATA #FIXED "usd">
<!ELEMENT paragraph (#PCDATA | emph | image)*>
<!ELEMENT emph (#PCDATA)>
<!ELEMENT image EMPTY >
<!ATTLIST image
file
CDATA #REQUIRED
height CDATA #IMPLIED
width CDATA #IMPLIED >
XML例如XML不是约束是这一个
version="1.0" encoding="UTF-8"?>
<!DOCTYPE inventory SYSTEM "books.dtd">
<inventory>
<book num="b1">
<title>Snow Crash</title>
<author>Neal Stephenson</author>
<publisher>Spectra</publisher>
<price>14.95</price>
<chapter>
<title>Snow Crash - Chapter A</title>
<paragraph>
This is the
<emph>first</emph>
paragraph.
<image file="firstParaImage.gif"/>
After image...
</paragraph>
<paragraph>
This is the
<emph>second</emph>
paragraph.
<image file="secondParaImage.gif"/>
After image...
</paragraph>
</section>
</chapter>
</book>
<book num="b3">
<title>Zodiac</title>
<author>Neal Stephenson</author>
<publisher>Spectra</publisher>
<price>7.50</price>
<chapter>
<title>Zodiac - Chapter A</title>
</chapter>
</book>
</inventory>
我知道如何寻找所有的书价difrent从14.95 ..但我现在不如何做,如果statment在XPTH 的assigme NT是XPTH只有
请务必张贴**有效** XML,特别是当也发布DTDs ... – 2013-04-27 09:55:21