[daisy] How to navigate XmlObjectXMLizable in JX Templates?

Paul Focke paul at outerthought.org
Thu Dec 28 02:18:14 CST 2006


On Wednesday 27 December 2006 20:59, Robert Cecil wrote:
> Hi I am building a couple of custom search functions, taking the
> approach:
>
> 1. A Flowscript that performs a query against the Query manager.
> 2. Creates a new  XmlObjectXMLizable object, using the
> searchResultDocument from the query output.
> 3. Stuff that object into a viewData, and
> 4. Calling cocoon.sendPage() for a JX template.
>
> I would like to be able to parse the  XmlObjectXMLizable object in my
> template but I can't seem to infer the structure. To test, I added
> temporarily
>
> <jx:out value="${pageXml}" />
>
> to my template, and I can see the unformatted results in my page.
>
> I would like to be able do something like:
>
> <jx:forEach var="row" items="${pageXml.searchResult.rows}" >
>
> And iterate over each row.
>
> Thanks!
>
> Rob Cecil

The thing is that the search result and underlying elements are namespaced 
to "http://outerx.org/daisy/1.0".  Now I read somewhere that jxpath 
expressions pick up the namespace prefix mappings that are found in the 
jxtemplate.  This would mean that an expression as
#{$pageXml/d:searchResult/d:rows/d:row} should work (if the prefix d is 
declared in the jxtemplate) but sadly it doesn't.  Perhaps someone on the 
list with more cocoon knowledge might tell us what's up here.

Paul


More information about the daisy mailing list