[xuriella-devel] Question concerning custom xpath functions returning node sets

rm at tuxteam.de rm at tuxteam.de
Sun May 20 18:50:27 UTC 2012


On Sun, May 20, 2012 at 08:03:59PM +0200, David Lichteblau wrote:
> Quoting rm at tuxteam.de (rm at tuxteam.de):
> > No, that's pretty much the same (api-wise) as dom:create-text-node ...).
> > Well, for this special case I wouldn't need a document instance, so stp
> > would be a workarround to be used in xpath functions. But it feels wrong
> > to use a implementation-specific api for my task. And it stil won't be
> > a general way to return node-sets of booleans or numbers.
> > 
> >  Thanks RalfD
> > 
> > P.S.: I think the issue here is that xpath view of xml documents isn't
> > the same as xml/dom's ....
> 
> I'm actually not entirely certain how I would approach this task if it
> came up in my code.
> 
> But I suspect I might use (or make up) my very own objects
> (independently of dom or stp, suited to the needs of the application)
> and define the appropriate methods on generic functions in the
> xpath-protocol package to inform xpath about how to understand those
> objects.  (This protocol is possibly as not well documented as it ought
> to be, but is meant to be user-visible and supported.)


O.k. - but while that seems possible to solve "my" problem, but since 
pp-xpath provides an api to extend its functionality I'd expect there to
be a way to return xpath types from those functions. It seems redundant
for each extension to design/implement a exptension-specific object
system. So I'd expect something like (xpath:to-node 42) etc. 
Or even (xpath-sys:make-node-set (list 3 4 5 6) :unordered) 

 Cheers, RalfD

> 
> d.
> 
> _______________________________________________
> xuriella-devel mailing list
> xuriella-devel at common-lisp.net
> http://lists.common-lisp.net/cgi-bin/mailman/listinfo/xuriella-devel




More information about the xuriella-devel mailing list