Skip to content

Commit

Permalink
Add function "addOptions()"
Browse files Browse the repository at this point in the history
  • Loading branch information
p-muessig committed May 20, 2016
1 parent 25a6766 commit 46a1a15
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
.idea/
javaLibs/
node_modules/
logs
*.log
npm-debug.log*
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,20 @@ __Arguments__

* path {String} - _The path to an Java archive file._


### addOptions(...options)

Adds options to the JVM.

__Arguments__

* options {...String} - _The options to be added to the JVM._

## License

(The MIT License)

Copyright (c) 2014 [E2E Technologies Ltd](http://www.e2ebridge.com)
Copyright (c) 2014 [Scheer E2E AG](http://www.e2ebridge.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -85,4 +94,4 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

by [E2E Technologies Ltd](http://www.e2ebridge.com)
by [Scheer E2E AG](http://www.e2ebridge.com)
11 changes: 11 additions & 0 deletions lib/xslt4node.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@ module.exports.addLibrary = function (path) {
}
};

/**
*
* @param {...String} [options]
*/
module.exports.addOptions = function (/* options */) {
var args = Array.prototype.slice.call(arguments);
args.forEach(function (arg) {
java.options.push(arg);
});
};

/**
*
* @param config
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xslt4node",
"version": "0.2.1",
"version": "0.3.1",
"description": "A XSLT package wrapping the XSLT interface of the Java API for XML Processing (JAXP)",
"dependencies": {
"java": ">=0.3.1",
Expand All @@ -14,14 +14,14 @@
"url": "https://github.com/e2ebridge/xslt4node.git"
},
"author": {
"name": "E2E Technologies Ltd",
"name": "Scheer E2E AG",
"email": "[email protected]",
"url": "http://e2ebridge.com"
},
"maintainers": [
{
"name": "Peter Müssig",
"email": "pmuessig@e2ebridge.com"
"email": "peter.muessig@scheer-group.com"
}
],
"license": "MIT",
Expand Down
1 change: 1 addition & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ var fs = require('fs');
var xslt4node = require('../lib/xslt4node');
var transform = xslt4node.transform;
//xslt4node.addLibrary('./javaLibs/saxon9he.jar');
//xslt4node.addOptions('-Xmx1g', '-Dgugus=foobar');

var ORDER = '<order><book ISBN="10-861003-324"><title>The Handmaid\'s Tale</title><price>19.95</price></book><cd ISBN="2-3631-4"><title>Americana</title><price>16.95</price></cd></order>';
var DISCOUNT = '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:param name="discount"/><xsl:template match="/"><order><xsl:variable name="sub-total" select="sum(//price)"/><total><xsl:value-of select="$sub-total"/></total>15% discount if paid by: <xsl:value-of select="$discount"/></order></xsl:template></xsl:stylesheet>';
Expand Down

0 comments on commit 46a1a15

Please sign in to comment.