Would you need the XML data across page requests, or only for a single request.
If it's only for a single request, I'd suggest storing the data in a HttpContext Item ... however, there's nothing out-of-the-box with Umbraco that can get/set objects to Items - there's umbraco.library:GetHttpItem - but that only gets a string.
Thinking that you'll need to write an XSLT extension for it.
How about serving the XML as a page within Umbraco and then using the built-in GetXmlDocumentByUrl() extension method to retrieve it, utilizing the cacheSeconds parameter to cache the result?
Exactly. Darren gave me a hint about serving the xml via an Umbraco page and cache it with Darren Fergusons own excellent Feed Cache package ( http://kenny.no/archive/2010/12/8/xml-views-in-umbraco ) but I had to be more dynamic and changed tit to GetXmlDocumentByUrl(url,seconds).
Caching an XSLT variable?
Hi all.
I'm searching for a way to cache a lot of xml content. The xml is fetched from different external sources and transformed using xslt.
The xml will be used in almost all xslt macros in the solution.
Example:
I think it should be possible to create xslt extension for save and load.
If is it not possible to transfer nodeset as parametr (for save method), you can pass it as string :-)
Hi Jesper,
Would you need the XML data across page requests, or only for a single request.
If it's only for a single request, I'd suggest storing the data in a HttpContext Item ... however, there's nothing out-of-the-box with Umbraco that can get/set objects to Items - there's umbraco.library:GetHttpItem - but that only gets a string.
Thinking that you'll need to write an XSLT extension for it.
Cheers, Lee.
Hi Jesper,
How about serving the XML as a page within Umbraco and then using the built-in GetXmlDocumentByUrl() extension method to retrieve it, utilizing the cacheSeconds parameter to cache the result?
/Chriztian
Hi Christian,
Exactly. Darren gave me a hint about serving the xml via an Umbraco page and cache it with Darren Fergusons own excellent Feed Cache package ( http://kenny.no/archive/2010/12/8/xml-views-in-umbraco ) but I had to be more dynamic and changed tit to GetXmlDocumentByUrl(url,seconds).
Works like a charm!
/Jesper
is working on a reply...