Templates in XQueryRob Koberg rob at koberg.com
Mon Sep 6 09:44:51 PDT 2010
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!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format