XQuery Month function

airjsorsdanxoy

New Member
I have following DTD:\[code\]<!DOCTYPE guests [<!ELEMENT Guest (Gname, youth+, car+)><!ELEMENT youth (Yname, dateofbirth)><!ELEMENT car (carType, excursion+)><!ELEMENT excursion (week, location)><!ELEMENT Gname (#PCDATA)><!ELEMENT Yname (#PCDATA)><!ELEMENT dateofbirth (#PCDATA)><!ELEMENT carType (#PCDATA)><!ELEMENT week (#PCDATA)><!ELEMENT location (#PCDATA)>>]\[/code\]and i want to use XQuery to find name of all guests who have a youth whose birthday is in August. this is what i came up with:\[code\]for $x in Guest/youthlet $GuessN := $x/@Gnamewhere $x/month:=8return <Gname> $GuessN </Gname>\[/code\]and\[code\]For $x in Guest/youth[month=8]Return <Gname>$x/@Gname </Gname>\[/code\]is there any function to read Month ?
 
Back
Top