[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

Templates in XQuery

Rob Koberg rob at koberg.com
Mon Sep 6 09:44:51 PDT 2010


  Templates in XQuery
I like doing the transform based on the request. Use the path or
parameter(s) to name a root element. Stream/form the source XML from
the path, request method, parameters and headers. In the transform,
gather content and configuration from the request data and style based
on the root element. Importantly, I think, is having one giant XSL
(with imports and includes) always loaded in memory (with a reload
URL), rather than many small ones that import/include the same thing
over an over (there is no reuse/sharing).

best,
-Rob


On Mon, Sep 6, 2010 at 4:36 AM, Florent Georges <http://x-query.com/mailman/listinfo/talk> wrote:
> Andrew Welch wrote:
>
>  Hi,
>
>> For example:
>
>> - you hit the page "/foo/bar.xslt"
>
>> - that xslt is executed starting at the template with the name
>> "main"
>
>  Well, that can seem useful for simple examples, but as soon as
> you want to make more complex things, you need more flexibility.
> What I ended up to in EXPath is to define a deployment descriptor
> to map URIs to components (XQuery but also XSLT and XProc) on the
> one hand, and a way to represent the HTTP request in XML (and the
> response) on the other hand.
>
>  Basically the server <http://code.google.com/p/servlex/> gets
> the HTTP request, transforms it to an XML element, gets the
> component matching the URI, calls it with the HTTP request in XML,
> analyzes the response (describing the HTTP response), and responds
> to the user.
>
>  I think the ideal situation if you need an XML database would
> be to have an XProc processor available first-class (at the same
> level as the XQuery engine), driving the interactions between
> XQuery and XSLT.
>
>  But I think an external XProc processor, calling queries on the
> database server, and applying stylesheets on this result (the
> usual approach now) is good enough for most cases.  People used
> to think this is too slow because the queries are not executed in
> the same process.  But if you look at all "enterprise apps" using
> SQL backends, that's exactly what happens.  If the queries are
> properly designed to return the needed pieces of info, that
> architecture is ok.
>
>  Regards,
>
> --
> Florent Georges
> http://fgeorges.org/
>
>
>
>
>
> _______________________________________________
> http://x-query.com/mailman/listinfo/talk
> http://x-query.com/mailman/listinfo/talk
>



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.