XPath expression doesn't work

NDH

New Member
I have an XML file like this : \[code\]<?xml version="1.0" encoding="UTF-8"?><!ELEMENT family (person)+><!ELEMENT person (name) ><!ATTLIST person idnum ID #REQUIREDgender (male | female) #REQUIREDfather IDREF #IMPLIEDmother IDREF #IMPLIEDchildren 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>\[/code\]I want to check the queries : [*]All the people with no children (both \[code\]male\[/code\] & \[code\]female\[/code\]) [*]All the people with no male children (ie. \[code\]SONS\[/code\])I've tried :[*]\[code\]/family/person[count(children)==0]\[/code\][*]\[code\]/family/person[count(children)==0 and children!=male]\[/code\]But it doesn't work . Can you please explain ? thanks .
 
Back
Top