On Dec 8, 8:17 am, Elijah Insua <
tmp...@gmail.com> wrote:
> Nice idea!
>
> I would really prefer this type of templating to the typical mixing of view
> logic with controller logic in a typical mvc type pardigm.
>
> I went down the road to see how difficult it would be to integrate this into
> node properly and it seems like there are a couple roadblocks.
>
> 1) unless I am mistaken, libxmljs doesn't have a proper browser type DOM
> model which makes many of the libraries that pure is compatible with, fail.
>
> 2) I also went down the road of using env.js, but unfortunately it doesn't
> appear to be CommonJS module compatible. (I've made a post on their mailing
> list:
http://groups.google.com/group/envjs/browse_thread/thread/2d5acefd5cb...)
>
> At this point I envision utilizing envjs to provide a browser type wrapper
> for pure using libxmljs as a backend. Not sure if I am completely off my
> rocker though!
We could try something without DOM.
As a first shot, I would just take a clean HTML as a template,
some JSON data, mix them both to send the page to the browser.
PURE on the browser use DOM/CSS selectors to spot the node to
modify or repeat.
XPATH is very similar as CSS selectors to select nodes.
Though their syntax is different, but I found that
Joe Hewitt wrote a promising CSS Selector -> XPATH converter
http://www.joehewitt.com/blog/files/getElementsBySelector.js
>
> -- Elijah
>
>
>
> On Mon, Dec 7, 2009 at 5:47 PM, Mic (BeeBole) <
tch...@gmail.com> wrote:
> > Hi,
> > I'd like to port the templating engine PURE(
http://github.com/pure/pure
> > ) to nodejs... but quickly found there is no DOM on that side...
> > Then I thought that an XML parser over XHTML templates would do it
> > just fine, and could convert CSS selectors to Xpath.
> > Some modifications of pure.js would be needed too.
> > In the end it could be a good and same way to generate HTML on both
> > the client and the server with javascript.
>
> > I'll probably start withhttp://
libxmljs.squishtech.com/.
> > Any advice or idea?
>
> > Thanks,
> > Mic
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "nodejs" group.
> > To post to this group, send email to
nod...@googlegroups.com.
> > To unsubscribe from this group, send email to
> >
nodejs+un...@googlegroups.com<
nodejs%2Bunsu...@googlegroups.com>
> > .