Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement EXSLT functions, e.g. exsl:node-set ? #109

Closed
Boddlnagg opened this issue Mar 29, 2017 · 4 comments
Closed

Implement EXSLT functions, e.g. exsl:node-set ? #109

Boddlnagg opened this issue Mar 29, 2017 · 4 comments

Comments

@Boddlnagg
Copy link
Contributor

I have an XSLT script that uses the node-set function defined by EXSLT. It works in Firefox, which has some EXSLT support. Depending on how hard this would be to implement (node-set shouldn't be too hard), I think having it in this Rust library would be great!

@Boddlnagg
Copy link
Contributor Author

Boddlnagg commented Mar 29, 2017

Oh, I see there already is #50 ... sorry. You can consider this to be a special request for the node-set function, then.

@shepmaster
Copy link
Owner

Thank you! I'm going to go ahead and close this as a duplicate of #50. I definitely agree that there's a bunch of EXSLT functionality that is super useful.

(node-set shouldn't be too hard)

Implementing functions isn't that bad! You can take a look at the file that defines all the current functions. The documentation for Context even shows how you can create user-specified functions.

I'd certainly appreciate a pull request adding node-set!

@Boddlnagg
Copy link
Contributor Author

I see that implementing node-set doesn't make sense right now, because there is no implementation of XSLT yet. The whole point of node-set is to turn "Result Tree Fragments" into proper XPath Nodesets, but right now "Result Tree Fragments" do not exist, because they are an addition of XSLT 1.0 to XPath (see https://www.w3.org/TR/xslt#section-Result-Tree-Fragments). I actually remember now that I opened #61 about this almost two years ago 😅 .

Another complication is that EXSLT functions are namespaced (e.g. xmlns:exsl="http://exslt.org/common", then you can use exsl:node-set(...)), which currently does not seem to be supported and actually also only makes sense in the context of XSLT.

@shepmaster
Copy link
Owner

which currently does not seem to be supported

It should be:

context.set_function(("http://exslt.org/common", "node-set"), NodeSetFunction)

only makes sense in the context of XSLT

Nah, that's a concept of XPath.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants