I'm using exist-db to parse XML documents. I am writing a xquery script to process the documents.
My XML input looks something like this
<data>
<schedules>
<schedule>
<event date="2015-08-28"/>
<event date="2015-08-29"/>
</schedule>
</schedules>
</data>
I want to use xquery/xpath to select all events where event/@date = "2015-08-28".
I tried this
let $rawDoc := collection("/db/test")/data/schedules/schedule[event/@date = "2015-08-28"]
but I get back this
<data>
<schedules>
<schedule>
<event date="2015-08-28"/>
<event date="2015-08-29"/>
</schedule>
</schedules>
</data>
when I want this
<data>
<schedules>
<schedule>
<event date="2015-08-28"/>
</schedule>
</schedules>
</data>
it seems like the presence of the "-" in either the date attribute value or my query string is not being treated as an explicit dash. It isn't clear to me how to escape the "-"? I tried "-" and that didn't work (no results returned).
Any ideas?
Thanks, Ty