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 following to create a new object. NodeType is a complex type name in this case.
{name: {localpart: nodeType}, value:{}};
Then I tried to fill values (I traverse through the schema mappings to find out all possible properties for each type). However, I get e.g. the following error that does not help me very much: Element [ELEMNAME] is not known in this context
If this is not possible, how do I in general create a new object that is supposed to be conform to the schema?
Thanks a lot for any idea!
EDIT: Okay to be more specific here an example:
"NodeType":{
"type":"object",
"title":"NodeType",
"properties":{
"id":{
"title":"id",
"allOf":[
{
"$ref":"http://www.jsonix.org/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/string"
}
],
"propertyType":"attribute",
"attributeName":{
"localPart":"id",
"namespaceURI":""
}
},
"x":{
"title":"x",
"allOf":[
{
"$ref":"http://www.jsonix.org/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/decimal"
}
],
"propertyType":"attribute",
"attributeName":{
"localPart":"x",
"namespaceURI":""
}
},
"y":{
"title":"y",
"allOf":[
{
"$ref":"http://www.jsonix.org/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/decimal"
}
],
"propertyType":"attribute",
"attributeName":{
"localPart":"y",
"namespaceURI":""
}
}
This is one JSON Schema excerpt from my XSD file. What I want is an Object that looks like this:
{id:"", x: "", y: ""}
The goal is to marshall this object then to XML.