Hi ...
I'm trying to get a handle on things XML and found the following code on
Wikipedia:
<html><head/><body>
{
for $act in doc("hamlet.xml")//ACT
let $speakers := distinct-values($act//SPEAKER)
return
<span>
<h1>{ $act/TITLE/text }</h1>
<ul>
{
for $speaker in $speakers
return <li>{ $speaker }</li>
}
</ul>
</span>
}
</body></html>
I saved this in file "hamlet.htm" along with the referenced file ("hamlet.xml") in the same directory; when I try to open "hamlet.htm" in either IE6 or Firefox 2 all I get is sort of a truncated version of the hamlet.htm file ..
What am I not doing right here? It's an HTML file so it would seem IE or FF are the right tools to use ... do they not support XQuery? Do I need to use a different kind of tool? Or am I thinking about all of this the wrong way entirely?
btw, I have no problem opening the hamlet.xml file in either IE or Firefox, so it appears to be well-formed
Any advice or information ?
TIA
I'm trying to get a handle on things XML and found the following code on
Wikipedia:
<html><head/><body>
{
for $act in doc("hamlet.xml")//ACT
let $speakers := distinct-values($act//SPEAKER)
return
<span>
<h1>{ $act/TITLE/text }</h1>
<ul>
{
for $speaker in $speakers
return <li>{ $speaker }</li>
}
</ul>
</span>
}
</body></html>
I saved this in file "hamlet.htm" along with the referenced file ("hamlet.xml") in the same directory; when I try to open "hamlet.htm" in either IE6 or Firefox 2 all I get is sort of a truncated version of the hamlet.htm file ..
What am I not doing right here? It's an HTML file so it would seem IE or FF are the right tools to use ... do they not support XQuery? Do I need to use a different kind of tool? Or am I thinking about all of this the wrong way entirely?
btw, I have no problem opening the hamlet.xml file in either IE or Firefox, so it appears to be well-formed
Any advice or information ?
TIA