Quantcast

REST GET with _query AND _xsl doesn't apply stylesheet

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

REST GET with _query AND _xsl doesn't apply stylesheet

Brad Clements
Hi,

I'm running 1.0-dev-20050805

I have a document that I have been applying a stylesheet to using a
REST GET operation.

Works great.

Now, I want to limit the elements to which the stylesheet is applied, so I'm
trying to apply a _query arg in addition to the _xsl argument.

The devguide doesn't say these are mutually exclusive. However I find
that if I specify _query, then _xsl is not applied.

I thought the _query would be applied, then the _xsl would be applied to
that output.

What happens is,

if I specify only _xsl, I get all the elements properly converted

If I also specify _query, I get matching elements, but the stylesheet is not
applied.

My url looks like this (sorry it wraps in my email program):

http://server1.strader-
ferris.com:8680/exist/servlet/db/orgs/ang/orders.xml?
_wrap=no&
_xsl=orders_to_list.xsl&
_query=%2F%2Forder%5B%40invoice_date+%3D+%272005%2F09%2F
09%27%5D


Is the order of arguments important? If I specify _xsl after _query, would
that matter? I'm using python client and urllib, it gets arguments from a
dict, so specifying the order would require a little more work on my part
since dictionaries are not ordered in Python.

---


Basically I want to pull elements that have @invoice_date within 30 days
of today. But, the client makes that decision, not the stylesheet.

I suppose the client could pass a cutoff date argument, if the stylesheet
could get at that argument using some exist specific function, but I'd
prefer not to do it that way..

Suggestions?


--
Brad Clements,                [hidden email]    (315)268-1000
http://www.murkworks.com                         
AOL-IM or SKYPE: BKClements




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: REST GET with _query AND _xsl doesn't apply stylesheet

wolfgangmm
Hi,

> The devguide doesn't say these are mutually exclusive. However I find
> that if I specify _query, then _xsl is not applied.

Yes, you can't use both, _query and _xsl. The xsl is not applied to
query results. While it would be possible to implement the missing
functionality, recent snapshots provide an alternative way which
should - in my opinion - be preferred: store the xquery into the
database and call the transform:transform() function at the end.

This should be equally efficient as the _xsl solution (transform()
caches the stylesheets), though the transformation result is first
transformed into an eXist-internal representation before it is
serialized and thus requires some more memory. I wrote a new function,
stream-transform() yesterday, which fixes this last problem by
streaming the transformation results directly into the http output
stream. It will be available in the next snapshot.

Wolfgang


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Loading...