私はこのようなXMLファイルを持っています:
<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT family (person)+>
<!ELEMENT person (name) >
<!ATTLIST person idnum ID #REQUIRED
gender (male | female) #REQUIRED
father IDREF #IMPLIED
mother IDREF #IMPLIED
children IDREFS #IMPLIED >
<!ELEMENT name (#PCDATA)>
<?xml version="1.0"?>
<!DOCTYPE family SYSTEM "family.dtd">
<family>
<person idnum = "T11" gender = "male" children ="T13 T14 T15"><name>11</name></person>
<person idnum = "T12" gender = "female" children ="T13 T14 T15"><name>12</name></person>
<person idnum = "T13" gender = "male" father="T11" mother="T12"><name>13</name></person>
<person idnum = "T14" gender = "male" father="T11" mother="T12"><name>14</name></person>
<person idnum = "T15" gender = "female" father="T11" mother="T12" children="T33"><name>15</name></person>
<person idnum = "T21" gender = "male" children="T23"><name>21</name></person>
<person idnum = "T22" gender = "female" children="T23"><name>22</name></person>
<person idnum = "T23" gender = "male" father="T21" mother="T22" children="T33"><name>23</name></person>
<person idnum = "T33" gender = "female" father="T23" mother="T15"><name>33</name></person>
</family>
クエリを確認したい:
子供がいないすべての人(
male
&の両方female
)男性の子供がいないすべての人々(すなわち
SONS
)
私はもう試した :
/family/person[count(children)==0]
/family/person[count(children)==0 and children!=male]
しかし、それは機能しません。
説明してもらえますか?ありがとう 。