0.1.14 • Published 8 years ago

saxon-java v0.1.14

Weekly downloads
6
License
ISC
Repository
github
Last release
8 years ago

saxon-java

Beware that this version currently only works with NODE.JS 4.x.x, compiled stylesheets and java

var saxonJava = require('saxon-java.js');

install java development!

transform

saxonJava.transform(args, options)

transform @param args args.file:'', args.xsl:'', args.params : {...} @param options timing : '' recoveryPolicy : 'silent|recover|fatal' versionWarning : 'on|off' standardErrorOutputFile: '...file...' @returns {*|promise}

compileTemplate

saxonJava.compileTemplate(stylesheets, options)

compileTemplate @param stylesheets @param options @returns {*}

Options

options.edition = 'saxon9he' | 'saxon9b' default = 'saxon9he' options.showEdition = true | false default = false options.saxonJavaWithTemplates => compileTemplate(stylesheets, options)

saxon9he

http://www.saxonica.com/documentation9.5/using-xsl/commandline.html

saxon9b

http://saxon.sourceforge.net/

Saxonica

Saxonica kent 2 manieren om aangeroepen te worden;

  • The JAXP interface
  • The s9api interface

Lees hierover meer op: http://www.saxonica.com/html/documentation/using-xsl/embedding/

Tot vandaag heb ik de JAXP interface gepakt omdat hierover ook het meeste op internet te vinden is. Dit namelijk de ‘standaard interface’ waarmee bijvoorbeeld ook Xalan en Oracle werken. Echter – lees ook bovenstaande link – deze heeft een aantal ‘’drawbacks’’

Ik heb daarom vandaag ook de s9api interface geïmplementeerd. (Deze is nog niet volledig af omdat ik nog met de setParameter worstel!) Deze werkt niet met een factory maar met een processor.

Wat betreft de snelheid maakt het – op dit moment – geen verschil. Maar, zo is ook te lezen in de link;

An alternative is to use Saxon's own s9api interface. This is designed to provide an integrated approach to XML processing across the different range of languages supported by Saxon; unlike JAXP, it includes support for XSLT 2.0 and 3.0 capabilities, and it also takes advantage of generics, thus giving a more strongly typed and therefore more robust interface.

s9API

De processor heeft een documentbuilder nu even db genoemd.

var db = processor.newDocumentBuilderSync();

var source = StreamSource(file); // file = XML bestand var xdmnode = db.buildSync(source);

De transformer (result) kan nu als volgt worden aangestuurd om de hele XML in te lezen.

result.setParameter(Qname('var_xbrl'),xdmnode);

De uitvoer van een transformatie kan ook een xdmnode zijn;

var XdmDesination = java.import('net.sf.saxon.s9api.XdmDestination'); var dest = XdmDesination();

result.setDestinationSync(dest);

0.1.14

8 years ago

0.2.4

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.13

8 years ago

0.1.12

8 years ago

0.1.11

8 years ago

0.1.10

8 years ago

0.1.9

8 years ago

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.41

8 years ago

0.0.40

8 years ago

0.0.39

8 years ago

0.0.38

8 years ago

0.0.37

8 years ago

0.0.36

8 years ago

0.0.35

8 years ago

0.0.34

8 years ago

0.0.33

8 years ago

0.0.32

8 years ago

0.0.31

8 years ago

0.0.30

8 years ago

0.0.29

8 years ago

0.0.28

8 years ago

0.0.27

8 years ago

0.0.26

8 years ago

0.0.25

8 years ago

0.0.24

8 years ago

0.0.23

8 years ago

0.0.22

8 years ago

0.0.21

8 years ago

0.0.20

8 years ago

0.0.19

8 years ago

0.0.18

8 years ago

0.0.17

8 years ago

0.0.16

8 years ago

0.0.15

8 years ago

0.0.14

8 years ago

0.0.13

8 years ago

0.0.12

8 years ago

0.0.11

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago