Vadim Gritsenko wrote: > Joerg Heinicke wrote: >> On 12.11.2003 23:26, Vadim Gritsenko wrote: <snip/> >>> Had anybody considered writing some dom:/ pseudo protocol to >>> save/retrieve DOM fragments to/from request / session / application context? >> We have a Read/WriteDomSessionTransformer (for which Andrzej provided also a patch) doing this stuff. You mean replacing them with a dom pseudo protocol for simplicity and transparency? > > Yep. And use CInclude to read and SourceWritingT to write (CExclude ;-)
I have a nearly finished such source at my hard disk since ages, that I almost had forgotten. As you made it sound really useful, I think that I maybe should finish it ;) In its current incarnation it can be used for reading a fragment from a dom tree in a session parameter, described by an xpath. It an be also be used for writing or inserting xml in a dom tree in a session parameter at an xpath. The current syntax is something like: session:/attribute-name/xpath If I extend it to handle request / session / application context, which seem like a good idea, what syntax would be reasonable? dom:/[request,session,context]/attribute-name/xpath or maybe one should be a little bit more specific: dom:/[request-attribute,session-attribute,context-attribute]/attribute-name/xpath One could also have some kind of sub-protocols for choosing how the write operation should be performed: dom:write:/... dom:insert:/... WDYT? /Daniel
