Using a provider would be the most logical way to do this.

I did at one point write an apache handler that takes a URL and treats the path info part as an XPath query and returns all matching fragments in the underlying document (actually it used a dbxml database to store the documents, but files would be easier). Building a provider would be pretty darn easy.

Basically you could subclass the file provider and have get_strref apply $r->path_info as an XPath expression to the document using XML::LibXML. I'd say your looking at maybe 10 lines of code plus some error handling to give you an 'XPath provider'.

Another alternative would be to write a plugin which makes the path_info available to XSLT, then you can build a stylesheet using the document() function that just extracts the data you're interested in and away you go. I think such a module already exists, but I don't have my AxKit stuff at my fingertips here...

If there are just a few certain paths that you need you may be able to do it entirely using a <Location/> section for each one and appropriate configuration. That I'm not 100% sure about, it would require a little experimentation.

Richard Lewis wrote:

I'm new to AxKit and thought I'd try porting one of my existing Cocoon (2.1) web apps to AxKit (see http://www.studios.uea.ac.uk).

The sitemap for this web app interprets the URL like this:
http://www.studios.uea.ac.uk/{section}/{subsection}/{id}

(e.g. http://www.studios.uea.ac.uk/events/past/2004-10-11 displays the XML from:
<root>
<section id="events">
<subsection id="past">
<event id="2004-10-11">
and http://www.studios.uea.ac.uk/exits displays the XML from:
<root>
<section id="exits">
)


Is there a way of using Apache/AxKit to match the path as if it were a list of strings separated by '/'s and then pass those to an XSLT stylesheet as parameters? i.e., can I implement a 'virtual directory structure' with Apache/AxKit like I can in Cocoon?

My Cocoon setup has its XML content in one big file stored in DOC_ROOT/content/content.{lang-code}.xml and its images stored in DOC_ROOT/images. It establishes the user agent language and selects the correct 'generator' and allows images to be accessed from anywhere within the 'virtual directory structure'.

Any thoughts would be very welcome.

Cheers,
Richard


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to