[xuriella-devel] Question concerning custom xpath functions returning node sets
rm at tuxteam.de
rm at tuxteam.de
Sun May 20 18:23:19 UTC 2012
On Sun, May 20, 2012 at 07:47:27PM +0200, Raymond Wiker wrote:
> On May 20, 2012, at 19:45 , rm at tuxteam.de wrote:
> > It's not too obscure - but I'm still not shure how to achive my goal.
> > I'm looking for a public api to generate nodes. So far I've found
> > (dom:create-text-node doc data) but that leaves me with two questions:
> > first, from within a xpath extension function there's no obvious way to
> > access the document being processed (I might be missing something here
> > but I _think_ the xpath api should provide more context).
> > Second: dom:create-... isn't really a good match for xpath since one
> > can't create some of the xpath node types (booleans, numbers etc.).
> >
> > Somehow I feel this is more of a xpath api problem but maybe you
> > have some idea/input on this.
>
> I'm not 100% sure, but the function you're looking for may be cxml-stp:make-text... possibly in conjunction with xpath:make-node-set.
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 ....
More information about the xuriella-devel
mailing list