GithubHelp home page GithubHelp logo

joaovitorbf / xslt-string-server Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 31 KB

Container server to transform XML using SaxonJS's XSLT 3.0

JavaScript 95.87% Dockerfile 4.13%
container docker saxon-js xml xslt xslt-3

xslt-string-server's Introduction

xslt-string-server

Transform XML using SaxonJS's XSLT 3.0

Created to be the backend of https://github.com/joaovitorbf/xslt.info

- ATTENTION! THE FULL SERVER IS INSECURE IF YOU ALLOW USER INPUT! XSLT INJECTION CAN RUN ARBITRARY CODE INSIDE THE CONTAINER!
- IF YOU NEED DYNAMIC XSLT, CONSIDER USING THE COMPILEONLY VERSION AND PROCESSING IT CLIENTISDE VIA SAXONJS

To run the NOT RECOMMENDED and NO LONGER AVAILABLE on Docker Hub full server on localhost (replace port):

docker run -d -p 127.0.0.1:[port]:8080 joaovitorbf/xslt-string-server

To run compile-only server on localhost (replace port):

docker run -d -p 127.0.0.1:[port]:8080 joaovitorbf/xslt-string-server-compileonly

Use the /transform endpoint and pass your xml and xslt files as x-www-form-urlencoded.
The xml parameter is not needed if you are using the compile-only version.
Example generated by Postman:

var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");

var urlencoded = new URLSearchParams();
urlencoded.append("xml", "<yourxmlhere>"); // not required if using compileonly
urlencoded.append("xslt", "<yourxslthere>");

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: urlencoded,
  redirect: 'follow'
};

fetch("localhost:8080/transform", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

xslt-string-server's People

Contributors

joaovitorbf avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.