Questions tagged [jsonix]

Jsonix is a JavaScript library which provides JSON-XML interfaces that allows to marshalling and unmarshalling JSON to/from XML.

Jsonix is a JavaScript library which provides JSON-XML interfaces that allows to marshalling and unmarshalling JSON to/from XML.

Features:

  • Jsonix (JSON interfaces for XML) allows to convert between XML and JSON structures.
  • Jsonix can parse XML into JSON (this process is called unmarshalling) or serialize JSON in XML form (this is called marshalling).
  • These conversions are based on simple XML/JSON mappings which can be written manually or generated from an XML-Schema.

Advantages:

  • Strongly structured.
  • Type-safe.
  • (Optionally) XML Schema-driven.

The project Home Page: https://github.com/highsource/jsonix/

39 questions
17
votes
4 answers

Is there a JavaScript API for XML binding - analog to JAXB for Java?

In Java, we work a lot with JAXB2. Object<->XML mappings are defined as annotations in Java classes: @XmlRootElement(name="usertask", namespace="urn:test") public class UserTask { @XmlElement(namespace="urn:test") public String getAssignee()…
lexicore
  • 42,748
  • 17
  • 132
  • 221
4
votes
1 answer

XSD to JavaScript class conversion

With XSD.exe I can easily derive a C# or VB.NET class from a XSD file. Is there a tool available to convert XSD to JavaScript?
G33kKahuna
  • 1,730
  • 7
  • 24
  • 39
3
votes
3 answers

AJV schema validation fails

I am using Jsonix, I have used below mentioned command to generate jsonix mapping and jsonix schema as, java -jar jsonix-schema-compiler-full.jar -generateJsonSchema -d mappings books.xsd it is properly generating mapping and schema, I want to…
J1617
  • 91
  • 1
  • 10
3
votes
2 answers

Create empty object from XML schema using JSONIX

is it somehow possible to generate an empty object from an XML schema with JSONIX? I generally have problems creating new JS objects that fit to the XML schema. Thus, this would be really helpful. Any example would be very appreciated. I tried the…
mapf
  • 496
  • 1
  • 5
  • 21
3
votes
2 answers

JSONIX: Get restrictions and default value for properties

I am using JSONIX for marshalling and unmarshalling XML files. So far it works pretty well. What I am missing is the possibility to get default values and restrictions like minOccours and maxOccours-Values. Is this somehow possible with…
mapf
  • 496
  • 1
  • 5
  • 21
2
votes
1 answer

Why jsonix unmarshalling fails for artificial URIs

In my attempt to use a schema file that I created: ListMatchingProductsResponse.xsd, I run into an error similar to another post but I don't think that the underlying fix is that same. When I try to parse a sample response: var…
pulkitsinghal
  • 3,855
  • 13
  • 45
  • 84
2
votes
1 answer

Trying to understand why simple jsonix unmarshalling is failing

I am new to jsonix and interested mostly in using it to unmarshall xml data. I wrote a very basic test example but have been unsuccessful in getting it to work. var MyModule = { name: 'MyModule', typeInfos: [{ type: 'classInfo', …
2
votes
1 answer

JavaScript equivalent of .NET XML Deserialization

I'm looking for a JavaScript library that can deserialize/unmarshal XML (strings or DOM) to JavaScript classes in a way similar to the .NET XmlSerializer's Deserialize method. The functionality I'm looking for: Classes are defined as JavaScript…
Samu Lang
  • 2,261
  • 2
  • 16
  • 32
1
vote
2 answers

Jsonix Element and value restriction

I am using JSONIX to marshall and unmarshall XML received from other system. The XML I want to marshall and unmarshall 392.2361 392.24 I still cannot figure out how to unmarshall the value…
1
vote
1 answer

jsonix - How to create an element with prefix and without namespace?

I'm required to send an XML with the following elements: true
codingKit
  • 13
  • 4
1
vote
1 answer

How to include types outside generated package in jsonix?

I've excluded some xml types from jaxb2 generation, due the corresponding classes already exists in Java. Generation is perfectly working and classes are founded. When I'm trying to include the types by this tutorial, jsonix searches classes only…
Irina
  • 939
  • 1
  • 8
  • 26
1
vote
1 answer

Convert xsd to json schema (Jsonix, XMLSpy)

I am trying to convert xml schema to json schema. In some reason the json schema that I get is weird, and incorrect. I use Jsonix and Altova XMLSpy 2017 For instance, this is the given xsd
user2922456
  • 391
  • 4
  • 10
  • 24
1
vote
1 answer

Unmarshalling SOS GetCapabilities via JSONIX yields only abstract offering data

I am trying to use jsonix to unmarshall a GetCapabilities response from SOS_2_0. Below is the code I wrote to unmarshall the xml string. It seems to work fine however not all of the elements have been mapped correctly. function…
1
vote
1 answer

Add custom xsi namespace with jsonix

How is it possible to add a custom xsi namespaces to a XML file with jsonix? We would like to achieve the following: The best thing we could get was…
mapf
  • 496
  • 1
  • 5
  • 21
1
vote
1 answer

Jsonix enumerations

When creating Jsonix (2.x) mapping files from xsd schema it captures enumerations and all the acceptable values, e.g. { type: 'enumInfo', localName: 'TrackAdvanceNotificationStatusType', baseTypeInfo: 'String', values:…
1
2 3