Giter VIP home page Giter VIP logo

nodejs-xml-xsd-validation's Introduction

nodejs-xml-xsd-validation

Example of a Node.js RESTful API that returns users from an xml file. Have a validation method that checks if the xml is strict to the xsd schema

Steps to follow

Clone the repository

Use the following command to clone the repository to your current folder git clone https://github.com/SergioDiez/nodejs-xml-xsd-validation

Install the required dependencies

Enter in the nodejs-xml-xsd-validation folder and use the npm install command to install the required dependencies.

NOTE: xsd-schema-validator module requires java and javac to be installed.

Initialize the server

To initialize the server use npm start. This command will start a local server. You can now access using a web browser via URL: http://127.0.0.1:3000

Retrieve the users list

To get the users.xml content use: http://127.0.0.1:3000/users

Retrieve an specifig user

To get an specific user from the users.xml file use: http://127.0.0.1:3000/users/:id (E.g: http://127.0.0.1:3000/users/1 will retrieve the user with id 1)

The default response is using XML, to retrieve the value as JSON you can add the .json extension to the URL. (For example http://127.0.0.1:3000/users/1.json)

Validate users.xml with users.xsd schema

To validate the xml file with the xsd use the following URL: http://127.0.0.1:3000/validate The output will display if the validation was correct or not.

nodejs-xml-xsd-validation's People

Contributors

sergiodiez avatar

Stargazers

 avatar  avatar  avatar

Forkers

marmigrace

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.