From: Derek F. <fo...@hu...> - 2002-09-02 10:04:27
|
I notice from recent posts to this list that tcldom has some xpath support - selectNode and createNode. I've started to rely on these as they make my scripts much easier to write, and I'm at the point of ripping out all my DOM walking code and replacing it with selectNode calls. Before I do this I ought to check: since these calls are non standard, what is the prospect for their future? Will they get replaced with something else, or can I assume they'll be available on all forthcoming tclxml versions for the foreseeable future? -- The past: Smart users in front of dumb terminals |
From: Joe E. <jen...@fl...> - 2002-09-02 16:42:26
|
Derek Fountain wrote: > I notice from recent posts to this list that tcldom has some xpath support - > selectNode and createNode. I've started to rely on these as they make my > scripts much easier to write, and I'm at the point of ripping out all my DOM > walking code and replacing it with selectNode calls. > > Before I do this I ought to check: since these calls are non standard, what > is the prospect for their future? Will they get replaced with something else, > or can I assume they'll be available on all forthcoming tclxml versions for > the foreseeable future? The Expat-based implementation (in tcldom/src, formerly known as TclDOM-Pro) doesn't include XPath support, and probably never will unless someone else takes the trouble to implement it. I don't plan to -- IMO implementing XPath is more trouble than it's worth. (Personally, I use a homegrown XML query language built on top of TclDOM; it has most of the power of XPath, but was significantly easier to implement). --Joe English jen...@fl... |
From: Steve B. <Ste...@zv...> - 2002-09-02 21:46:14
|
Joe English wrote: > The Expat-based implementation (in tcldom/src, formerly known > as TclDOM-Pro) doesn't include XPath support, and probably > never will unless someone else takes the trouble to implement it. > I don't plan to -- IMO implementing XPath is more trouble than > it's worth. I wonder whether the Tcl implementation's XPath code is generalised enough to be used with a TclDOMPro DOM tree? I'd have to check to see if it only uses API calls, rather than peeking directly inside the node data structures. I'm pretty sure the createNode stuff falls into that category. This approach may apply to other features, such as events. > (Personally, I use a homegrown XML query language built on top > of TclDOM; it has most of the power of XPath, but was significantly > easier to implement). Horses for courses... Having invested the time in learning XPath, I like to leverage that investment. XPath is popping up all over the place - XSLT, XML-Query, DOM, etc. I've no doubt that it may be easier to design/implement other query languages (especially now that I've read the XPath v2.0 WD - phew!) but sticking to standards (as much as possible) is important to me. Cheers, Steve Ball -- Steve Ball | XSLT Standard Library | Training & Seminars Zveno Pty Ltd | Web Tcl Complete | XML XSL Schemas http://www.zveno.com/ | TclXML TclDOM | Tcl, Web Development Ste...@zv... +---------------------------+--------------------- Ph. +61 2 6242 4099 | Mobile (0413) 594 462 | Fax +61 2 6242 4099 |
From: Steve B. <Ste...@zv...> - 2002-09-02 21:37:16
|
Derek Fountain wrote: > I notice from recent posts to this list that tcldom has some xpath support - > selectNode and createNode. I've started to rely on these as they make my > scripts much easier to write, and I'm at the point of ripping out all my DOM > walking code and replacing it with selectNode calls. > > Before I do this I ought to check: since these calls are non standard, what > is the prospect for their future? Will they get replaced with something else, > or can I assume they'll be available on all forthcoming tclxml versions for > the foreseeable future? Well, I rely on XPath too so I'm pretty keen on making sure it continues to be supported. DOM Level 3 includes interfaces for XPath, so the standard itself will support XPath. Of course, bridging the gap between DOM and XPath's data models is not trivial so it's not all smooth sailing. As with all non-standard extensions, the syntax introduced in DOM Level 3 may not (will not) match the selectNode/createNode methods (btw, at least L3 has the notion of static node lists so we don't have to worry about live lists). The usual response to that is to keep the original syntax, deprecate it but maintain the extension syntax for the forseeable future. HTHs, Steve Ball -- Steve Ball | XSLT Standard Library | Training & Seminars Zveno Pty Ltd | Web Tcl Complete | XML XSL Schemas http://www.zveno.com/ | TclXML TclDOM | Tcl, Web Development Ste...@zv... +---------------------------+--------------------- Ph. +61 2 6242 4099 | Mobile (0413) 594 462 | Fax +61 2 6242 4099 |