On Tue, Mar 22, 2011 at 10:47 AM, LIN Sumang <[email protected]> wrote:
> The point here is that splices dispersed among the templates can't have a
> whole view how the dynamic tags should be grouped and to be executed in some
> batch mode.
>
> Consider the case below, some dynamic tags scatters over a big page so can't
> be grouped using runChildrenWithText().
>
> <p> <NAME1/> .... <NAME2/> ..... </p>
> <p> .... <AGE1/> ....
> .... <AGE2/> ... <MSG1/> ... <MSG3/>
> .... <MSG1> ..... <MSG2/>
> <NAME3/>...... <AGE2/>
> ........... and even more.
>
> Say NAME1, AGE1, MSG1, *1 can be computed by just parsing one file once,
> FILE1.xml, etc...
>
> I don't know if runChildrenWithText() can resolve this problem by just
> putting all tags above to a big splice. Seems runChildrenWithText() is
> designed for little html snippet and not for this case.

For this case, you'll probably need to do the caching in your Haskell
code.  Instead of having your splices read directly from a file, you
can have them read from an MVar stored in your application state.  The
MVar could be populated on application start-up or on-demand by the
splices--whatever best suits your application.
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap

Reply via email to