Did you try <c:out value="$art" /> in the foreach just to make sure the articles being returned are what you expect?
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alan Darnell Sent: Tuesday, April 03, 2007 6:45 PM To: General Mark Logic Developer Discussion Subject: [MarkLogic Dev General] MarkLogic XQuery Tag Library and JSTL XMLTag Library I'd like to be able to use these two libraries so that I can grab XML data from Mark Logic and then parse it using the JSTL XML libraries. Here's what I've got so far. Use xq:execute to populate "results" variable with documents. Iterate over "results" and pass each result converted to a string to x:parse, storing the parsed result in variable "art" But then when I try to access any elements of "art" I get a SAXPathException. Not sure what's happening but I'm new to using both tag libraries so .... Thanks in advance ... Alan <%@ taglib uri="http://marklogic.com/jsp/taglib" prefix="xq" %> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/xml" prefix="x" %> <xq:setDataSource host="..." port="..." user="..." password="..." /> <html><head><title>Test</title></head> <body> <c:choose> <c:when test="${param.query != null}"> <form action="search.jsp" method="post"> <input name="query" value="<c:out value="${param.query}" />" /> </form> <xq:execute var="results"> <xq:query> for $i in cts:search(doc()//article-title,"${param.query}") [1 to 15] return $i/root() </xq:query> </xq:execute> <ol> <c:forEach var="item" items="${results.items}"> <x:parse xml="${item.string}" var="art" scope="session" /> <li> <x:out select="$art//journal-id" /> </li> </c:forEach> </ol> </c:when> <c:otherwise> <form action="search.jsp" method="post"> <input name="query" value="" /> </form> </c:otherwise> </c:choose> </body> </html> _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
