jsonix

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

倖福魔咒の 提交于 2019-12-30 00:54:08
问题 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() { ... } public void setAssignee(String assignee) { ... } } JAXB runtime can read these annotations and create unmarshaller to parse XML into an object instance or marshall an object into XML. JAXB ships a schema compiler (XJC) which can generate annotated

Trying to understand why simple jsonix unmarshalling is failing

无人久伴 提交于 2019-12-23 23:20:52
问题 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', localName: 'AnyElementType', propertyInfos: [{ type: 'anyElement', allowDom: true, allowTypedObject:true, name: 'any', collection: false }] }], elementInfos: [{ elementName: 'sos:Capabilities', typeInfo: 'MyModule.AnyElementType' }] }; var context = new Jsonix.Context

JSONIX: Get restrictions and default value for properties

冷暖自知 提交于 2019-12-07 13:27:18
问题 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 JSONIX? These properties: <xsd:sequence> <xsd:element name="inflowMin" type="framework:flowType" minOccurs="0" maxOccurs="1"/> <xsd:element name="inflowMax" type="framework:flowType" minOccurs="0" maxOccurs="1"/> <xsd:element name="unitOfFlowControl" type=

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

◇◆丶佛笑我妖孽 提交于 2019-11-30 04:52:50
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() { ... } public void setAssignee(String assignee) { ... } } JAXB runtime can read these annotations and create unmarshaller to parse XML into an object instance or marshall an object into XML. JAXB ships a schema compiler (XJC) which can generate annotated classes out of XML Schemas, which is another great feature. Lately we've been working a lot with