On 2 Mar 2006 at 16:37, Paul Everitt wrote:
Stefan Behnel wrote:
Paul Everitt wrote:
Before writing and checking in a test, I want to find out if something is known behavior. I have an XSLT that uses XML data in the stylesheet itself. Essentially:
Sorry to barge in here.. I've been watching lxml for a while, waiting for it to support a custom resolver so I can use it in Paste and Zope, etc. Currently I'm using libxslt with Paste in my "tal2xslt" project. I rely on document('') as a way to inject "system-wide" constants into the .xsl files that are generated from the input TAL. I register a global resolver with libxslt and tag the URI associated with a given document so it can be tied back to the originating request. I use libxml2.readDoc() to associate a custom URI with each document. Each URI I load uses a custom scheme so I know it's "mine". Anyway, in the resolver if the scheme doesn't match my fake scheme, I just hand it back to libxslt and let it resolve itself. Can you do the same in lxml? I poked around http://codespeak.net/svn/lxml/trunk/src/lxml/ but couldn't find the module where you set the resolver.
Ok, point made. :^) I'm currently working around this by putting the nodes I want into the input document. However, that makes me pay a penalty on every request, instead of just once when the stylesheet is generated.
I can live with it, though. It's already lots faster than other templating approaches. :^)
Yeah, I love it. Edge side includes done via xml/xsl in the client. It's great. -- Brad Clements, bkc@murkworks.com (315)268-1000 http://www.murkworks.com AOL-IM or SKYPE: BKClements