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

Support simple extension functions written in JavaScript #5

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
"targets": [
{
"target_name": "node-libxslt",
"sources": [ "src/node_libxslt.cc", "src/stylesheet.cc" ],
"sources": [
"src/node_libxslt.cc",
"src/stylesheet.cc",
"src/extensions.cc"
],
"cflags" : [ "-O0 -g" ],
"include_dirs": ["<!(node -e \"require('nan')\")"],
'dependencies': [
'./deps/libxslt.gyp:libxslt',
'./deps/libxslt.gyp:libexslt'
]
}
]
}
}
2 changes: 1 addition & 1 deletion deps/libxslt.config/linux/arm/libxslt/xsltconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ extern "C" {
* Whether module support is configured into libxslt
* Note: no default module path for win32 platforms
*/
#if 0
#if 1
#ifndef WITH_MODULES
#define WITH_MODULES
#endif
Expand Down
2 changes: 1 addition & 1 deletion deps/libxslt.config/linux/ia32/libxslt/xsltconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ extern "C" {
* Whether module support is configured into libxslt
* Note: no default module path for win32 platforms
*/
#if 0
#if 1
#ifndef WITH_MODULES
#define WITH_MODULES
#endif
Expand Down
2 changes: 1 addition & 1 deletion deps/libxslt.config/linux/x64/libxslt/xsltconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ extern "C" {
* Whether module support is configured into libxslt
* Note: no default module path for win32 platforms
*/
#if 0
#if 1
#ifndef WITH_MODULES
#define WITH_MODULES
#endif
Expand Down
2 changes: 1 addition & 1 deletion deps/libxslt.config/mac/ia32/libxslt/xsltconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ extern "C" {
* Whether module support is configured into libxslt
* Note: no default module path for win32 platforms
*/
#if 0
#if 1
#ifndef WITH_MODULES
#define WITH_MODULES
#endif
Expand Down
2 changes: 1 addition & 1 deletion deps/libxslt.config/mac/x64/libxslt/xsltconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ extern "C" {
* Whether module support is configured into libxslt
* Note: no default module path for win32 platforms
*/
#if 0
#if 1
#ifndef WITH_MODULES
#define WITH_MODULES
#endif
Expand Down
2 changes: 1 addition & 1 deletion deps/libxslt.config/solaris/ia32/libxslt/xsltconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ extern "C" {
* Whether module support is configured into libxslt
* Note: no default module path for win32 platforms
*/
#if 0
#if 1
#ifndef WITH_MODULES
#define WITH_MODULES
#endif
Expand Down
2 changes: 1 addition & 1 deletion deps/libxslt.config/solaris/x64/libxslt/xsltconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ extern "C" {
* Whether module support is configured into libxslt
* Note: no default module path for win32 platforms
*/
#if 0
#if 1
#ifndef WITH_MODULES
#define WITH_MODULES
#endif
Expand Down
2 changes: 1 addition & 1 deletion deps/libxslt.config/win/ia32/libxslt/xsltconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ extern "C" {
* Whether module support is configured into libxslt
* Note: no default module path for win32 platforms
*/
#if 0
#if 1
#ifndef WITH_MODULES
#define WITH_MODULES
#endif
Expand Down
2 changes: 1 addition & 1 deletion deps/libxslt.config/win/x64/libxslt/xsltconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ extern "C" {
* Whether module support is configured into libxslt
* Note: no default module path for win32 platforms
*/
#if 0
#if 1
#ifndef WITH_MODULES
#define WITH_MODULES
#endif
Expand Down
12 changes: 11 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ exports.parseFile = function(sourcePath, callback) {
* @param {Stylesheet} [stylesheet]
*/

/**
* Register an extension function to be used in xpath expressions of a stylesheet
* @param {string} name
* @param {string} namespace
* @param {function} fn
*/
exports.registerFunction = binding.registerFunction;

process.on("exit", binding.shutdownOnExit);

/**
* Apply a stylesheet to a XML document
*
Expand Down Expand Up @@ -166,4 +176,4 @@ Stylesheet.prototype.applyToFile = function(sourcePath, params, callback) {
* @callback Stylesheet~applyToFileCallback
* @param {error} [err] - Error either from reading the file, parsing the XML document or applying the styleshet
* @param {string} [result]
*/
*/
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"dependencies": {
"bindings": "~1.2.1",
"libxmljs": "^0.11.1",
"nan": "~1.2.0"
"nan": "~1.7.0"
},
"devDependencies": {
"async": "~0.9.0",
Expand Down
Loading