Yes, this is exactly what hte problem was--the results were in the default namespace, but the HTML structure referred to another namespace. Setting the response content type didn't help; instead, I moved the XPath expressions out of the default namespace and into a declared namespace, and that did the trick.
Thank you very much for responding! -------------- Original message -------------- From: Mindie Sorenson <[EMAIL PROTECTED]> > Erin - It is definitely a namespace issue. It sounds like your results are in > the default namespace, but in your first example you are explicitly using the > xhtml namespace for your xhtml structure, so you are unable to access the > results in the different namespace. I believe your second example will work > if > you set the response content type right before the tag, like this: > > xdmp:set-response-content-type( "text/html" ) > > (you may need a comma right after it, depending on how your page is coded). > > Hope that helps. > Mindie > > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > [EMAIL PROTECTED] > Sent: Sunday, November 02, 2008 8:29 PM > To: [email protected] > Subject: [MarkLogic Dev General] problem rendering as HTML > > 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: > > > > > > > Search Results > > { > for $song in cts:search(/song, xdmp:get-request-field("search"))[1 to 100] > return {$song/name} > } > > Return to Artist list > > > > When I attempt to hit that page (with the search URL parameter defined, I get > back an HTML page with no results: > > > > > > Search Results Return to > Artist list > > > 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: > > > > > > > Search Results > > { > for $song in cts:search(/song, xdmp:get-request-field("search"))[1 to 100] > return {$song/name} > } > > Return to Artist list > > > > 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. > > − > > − > > > > − > > − > > Search Results > > > − > > − > > Burning Down The House > > > − > > − > > Rock Steady > > > − > > − > > Three Time Loser > > 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 > > ---------------------------------------------------------------------- > NOTICE: This email message is for the sole use of the intended recipient(s) > and > may contain confidential and privileged information. Any unauthorized review, > use, disclosure or distribution is prohibited. If you are not the intended > recipient, please contact the sender by reply email and destroy all copies of > the original message. > _______________________________________________ > General mailing list > [email protected] > http://xqzone.com/mailman/listinfo/general
_______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
