Hi, >> that subset. What I was mostly looking for was a way to just "grab" the >> results wanted from the fully-sorted list, to prevent iterating over all of I'm afraid that's currently not possible with standard XPath/XSLT instructions. If you use xsl:for-each/xsl:sort, it first evaluates select in doc order, then sorts, thus xsl:sort doesn't affect "select" expression. Clearly, in this case there should be a way in XPath to specify sorting and there's none. There might be an extension function available somewhere, that does this, but I didn't see one. I know that W3C is going to include sort functionality into new XPath2.0/XQuery specifications.
>> I did look at Tomcat for a bit yesterday, so I'll investigate it some more >> now. My main hesitancy is just that I have no experience developing Java, That's why you should go with Tomcat, it could minimize your developing and deployment efforts. Plus, there're XML/XSLT examples: http://xml.apache.org/xalan-j/samples.html#servlet Thanks, Dimitry -----Original Message----- From: Foxy Shadis [mailto:[EMAIL PROTECTED] Sent: Sunday, March 23, 2003 12:58 To: [EMAIL PROTECTED] Subject: RE: Xalan usage questions >I think you're jumping a gun stating the results were wrong. What did you >get and what did you expect? Sorry, with the second set it grabbed results in document order, then sorted that subset. What I was mostly looking for was a way to just "grab" the results wanted from the fully-sorted list, to prevent iterating over all of the extra results, similar to an SQL statement's "select top 5". I did look at Tomcat for a bit yesterday, so I'll investigate it some more now. My main hesitancy is just that I have no experience developing Java, only C/C++. But this solution is attractive enough that I'd like to try nonetheless. Thanks a lot, Josh Swiftpaw Foxyshadis, wildlife artist [EMAIL PROTECTED] | http://foxyshadis.dyndns.org/ >From: "Voytenko, Dimitry" <[EMAIL PROTECTED]> >To: "'Foxy Shadis'" <[EMAIL PROTECTED]>, [EMAIL PROTECTED] >Subject: RE: Xalan usage questions >Date: Sun, 23 Mar 2003 11:21:56 -0800 > >Hi, > > >> But as I mostly expected, this gave incorrect results. The spec never > >> touches on doing such a thing. Is there any feasible way of doing this? >One >I think you're jumping a gun stating the results were wrong. What did you >get and what did you expect? >XSLT specification is specific enough on the matter. You can read it here >http://www.w3.org/TR/xslt#sorting > > >> thought was to somehow keep the java runtime and xalan loaded in >memory, > >> ready to fire off another thread as soon as they're called. Or some >sort >of >This sounds like a task for Java servlet containers. There works exactly as >you describe here. In addition you can cache XSLT compiled stylesheets and >thus further improve performance. >You can use JServ, Tomcat and many others to do this. I would go with >Tomcat, since it simplifies deployment a lot. >There're samples of servlets implementing XML/XSLT transformations in the >Xalan. I'm not sure how easy it would be to use it with PHP though. One way >to do it is to make calls to such a servlet via HTTP, but I'm not sure if >this'd be acceptable for you. > >Thanks, >Dimitry > >-----Original Message----- > ><xsl:for-each select="$journal_entry"> ><xsl:sort select="@jid" data-type="number" order="descending"/> ><xsl:if test="position()<=2"> >... ></xsl:if> ></xsl:for-each> > >I would like to optimise it in a way similar to: > ><xsl:for-each select="$journal_entry[position()<=2]"> ><xsl:sort select="@jid" data-type="number" order="descending"/> >... ></xsl:for-each> > _________________________________________________________________ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail _____________________________________________________ Revere Data, LLC, formerly known as Sector Data, LLC, is not affiliated with Sector, Inc., or SIAC.