npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

saxon-java

v0.1.14

Published

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

Downloads

74

Readme

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);