All Projects → Mermade → jgeXml

Mermade / jgeXml

Licence: BSD-3-Clause license
The Just-Good-Enough XML Toolkit

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to jgeXml

jsons2xsd
Highly configurable converter from JSON-schema to XML-schema (XSD).
Stars: ✭ 65 (+225%)
Mutual labels:  json-schema, xsd, xml-schema
xslweb
Web application framework for XSLT and XQuery developers
Stars: ✭ 39 (+95%)
Mutual labels:  xsd, xml-schema
xsd-reader
Pure PHP XSD Reader (XML Schema)
Stars: ✭ 45 (+125%)
Mutual labels:  xsd, xml-schema
xrechnung-visualization
XSL transformators for web and pdf rendering of German CIUS XRechnung or EN16931-1:2017 [MIRROR OF GitLab]
Stars: ✭ 26 (+30%)
Mutual labels:  xsd, xml-schema
xml-lint
A php tool to lint and validate xml files from the commandline.
Stars: ✭ 14 (-30%)
Mutual labels:  xsd, xml-schema
Schm
Composable schemas for JavaScript and Node.js
Stars: ✭ 498 (+2390%)
Mutual labels:  parse, json-schema
php-simple-request
php-simple-request is a request parser library designed to simplify requests validation and filtering using annotations, generating at the same time an object representation from the request data.
Stars: ✭ 15 (-25%)
Mutual labels:  parse, json-schema
rpgdice
A generic RPG dice roller syntax and library.
Stars: ✭ 24 (+20%)
Mutual labels:  parse
asmdot
[Unstable] Fast, zero-copy and lightweight (Arm | Mips | x86) assembler in (C | C++ | C# | Go | Haskell | Javascript | Nim | OCaml | Python | Rust).
Stars: ✭ 23 (+15%)
Mutual labels:  parse
format-to-json
An algorithm that can format a string to json-like template. 字符串JSON格式化的算法。
Stars: ✭ 30 (+50%)
Mutual labels:  json-schema
robotframework-jsonvalidator
Robot Framework library for JSON validation
Stars: ✭ 21 (+5%)
Mutual labels:  json-schema
BaaSDelphiSamples
💾 Code samples for BaaS and PaaS using Delphi
Stars: ✭ 30 (+50%)
Mutual labels:  parse
cxf-spring-boot-starter
Enterprise & production ready SOAP webservices powered by Spring Boot & Apache CXF
Stars: ✭ 129 (+545%)
Mutual labels:  xml-schema
MarknoteParser
A high performance markdown parser in Swift.
Stars: ✭ 29 (+45%)
Mutual labels:  parse
xml-spac
Handle streaming XML data with declarative, composable parsers
Stars: ✭ 39 (+95%)
Mutual labels:  parse
check-jsonschema
A CLI and set of pre-commit hooks for jsonschema validation with built-in support for GitHub Workflows, Renovate, Azure Pipelines, and more!
Stars: ✭ 51 (+155%)
Mutual labels:  json-schema
JustJson
JSON helper library for Android
Stars: ✭ 15 (-25%)
Mutual labels:  json-schema
flow2schema
Generate json-schemas for flowtype definitions
Stars: ✭ 20 (+0%)
Mutual labels:  json-schema
color-math
Expressions to manipulate colors.
Stars: ✭ 18 (-10%)
Mutual labels:  parse
rasn1
Ruby ASN.1 library
Stars: ✭ 14 (-30%)
Mutual labels:  parse

jgeXml - The Just-Good-Enough XML Toolkit

Build status Join the Mermade Slack

Share on Twitter Follow on Twitter

jgeXml provides an event-driven parser to process XML 1.0 / 1.1. Both pull and push modes are supported. Tools are included for writing XML (documents or fragments) and to convert between XML and JSON.

The code has no dependencies on other modules or native libraries.

Setting up a push-parser is as simple as:

const jgexml = require('jgexml');
const result = jgexml.parse(xml, function(state, token) {
  //...
});

Events (stateCodes)

  • sDeclaration
  • sDocType
  • sDTD
  • sElement
  • sAttribute
  • sValue
  • sEndElement
  • sContent
  • sComment
  • sProcessingInstruction
  • sCData
  • sError
  • sEndDocument

No event is generated for ignoreable whitespace, unlike SAX. Empty elements are normalised into sElement/sEndElement pairs.

Notes

jgeXml is a non-validating parser. It attempts to report if the XML is well-formed or not.

Both when reading and writing, attributes follow after the element event, and in the order they are given in the source.

When converting to JSON, the attributePrefix (to avoid name clashes with child elements) is configurable per parse.

In JSON, child elements can be represented as properties (the default) or objects (exposing the parser's intermediary state).

The parser by default treats all content as strings when converting to JSON, optionally data can be coerced to primitive numbers or null values.

The xsd2json utility can convert most simple XML Schemas to JSON schema draft 4. XSD's may of course be converted to JSON simply as if they were XML documents too.

Experimental JSONPath and JSONT utilities are under development.

Limitations

jgeXml is currently schema agnostic and staunchly atheist when it comes to DTDs. It can parse XML documents with schema information, but it is up to the consumer to interpret the namespace portions of element names. It can parse internal DTDs, but does nothing with them. xmlWrite minimally supports DTDs but you must build them and the DOCTYPE yourself.

The parser is string-based; to process streams, read the data into a string first. It may be memory intensive on large documents.

CLI commands

  • xml2json - convert XML to JSON.
  • json2xml - convert JSON to XML.
  • xsd2json - convert XSD to JSON Schema.

Examples

See in the examples directory: xml2xml.js for parsing XML to XML, fragment.js for writing XML fragments, jpath.js for JSONPath examples, jsont.js for JSONT examples and pullparser.js / pushparser.js for how to set up and run the parser.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].