Just an observation: rather than
{
for $song in cts:search(/song, xdmp:get-request-field("search"))[1 to 100]
return <ul><li>{$song/name}</li></ul>
}
you probably want
<ul>{
for $song in cts:search(/song, xdmp:get-request-field("search"))[1 to 100]
return <li>{$song/name}</li>
}</ul>
unless you meant to display 100 separate lists, each with one list item.
Cheers,
Eric
[EMAIL PROTECTED] wrote:
Hi All,
I've got a problem rendering some XHTML results as HTML--I think it might be a
namespace problem, so I've been playing around with that all night, with no
luck. Here's my XQuery:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> Search Results</title>
</head>
<body>
<h1><b>Search Results</b></h1>
<br/>
{
for $song in cts:search(/song, xdmp:get-request-field("search"))[1 to 100]
return <ul><li>{$song/name}</li></ul>
}
<br/>
<a href="browse.xqy">Return to Artist list</a>
</body>
</html>
When I attempt to hit that page (with the search URL parameter defined, I get
back an HTML page with no results:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> Search Results</title>
</head>
<body><h1><b>Search Results</b></h1><br/><br/><a href="browse.xqy">Return to Artist
list</a></body>
</html>
It's rendered properly as HTML in the browser.
If I remove the xmlns attribute, I get results, but they are in an XML tree.
So here's my XQuery now:
<html>
<head>
<title> Search Results</title>
</head>
<body>
<h1><b>Search Results</b></h1>
<br/>
{
for $song in cts:search(/song, xdmp:get-request-field("search"))[1 to 100]
return <ul><li>{$song/name}</li></ul>
}
<br/>
<a href="browse.xqy">Return to Artist list</a>
</body>
</html>
This is the output from Firefox:
This XML file does not appear to have any style information associated with it.
The document tree is shown below.
−
<html>
−
<head>
<title> Search Results</title>
</head>
−
<body>
−
<h1>
<b>Search Results</b>
</h1>
<br/>
−
<ul>
−
<li>
<name>Burning Down The House</name>
</li>
</ul>
−
<ul>
−
<li>
<name>Rock Steady</name>
</li>
</ul>
−
<ul>
−
<li>
<name>Three Time Loser</name>
</li>
etc....
So what am I missing? It seems that there's some basic XHTML namespace issue
I'm not addressing correctly.
Many thanks,
Erin
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general