diff --git a/demos/po-npm/mappings/PurchaseOrder.compact.js b/demos/po-npm/mappings/PurchaseOrder.compact.js index 541d7e6..812d2ae 100644 --- a/demos/po-npm/mappings/PurchaseOrder.compact.js +++ b/demos/po-npm/mappings/PurchaseOrder.compact.js @@ -40,37 +40,14 @@ var PurchaseOrder_Module_Factory = function () { t: 'a' }] }, { - ln: 'PurchaseOrderType', + ln: 'Items', ps: [{ - n: 'shipTo', - en: { - lp: 'shipTo' - }, - ti: '.USAddress' - }, { - n: 'billTo', - en: { - lp: 'billTo' - }, - ti: '.USAddress' - }, { - n: 'comment', - en: { - lp: 'comment' - } - }, { - n: 'items', + n: 'item', + col: true, en: { - lp: 'items' - }, - ti: '.Items' - }, { - n: 'orderDate', - ti: 'Calendar', - an: { - lp: 'orderDate' + lp: 'item' }, - t: 'a' + ti: '.Items.Item' }] }, { ln: 'USAddress', @@ -108,25 +85,48 @@ var PurchaseOrder_Module_Factory = function () { t: 'a' }] }, { - ln: 'Items', + ln: 'PurchaseOrderType', ps: [{ - n: 'item', - col: true, + n: 'shipTo', en: { - lp: 'item' + lp: 'shipTo' }, - ti: '.Items.Item' + ti: '.USAddress' + }, { + n: 'billTo', + en: { + lp: 'billTo' + }, + ti: '.USAddress' + }, { + n: 'comment', + en: { + lp: 'comment' + } + }, { + n: 'items', + en: { + lp: 'items' + }, + ti: '.Items' + }, { + n: 'orderDate', + ti: 'Calendar', + an: { + lp: 'orderDate' + }, + t: 'a' }] }], eis: [{ + en: { + lp: 'comment' + } + }, { en: { lp: 'purchaseOrder' }, ti: '.PurchaseOrderType' - }, { - en: { - lp: 'comment' - } }] }; return { diff --git a/demos/po-npm/mappings/PurchaseOrder.jsonschema b/demos/po-npm/mappings/PurchaseOrder.jsonschema index 80c2ca9..f103688 100644 --- a/demos/po-npm/mappings/PurchaseOrder.jsonschema +++ b/demos/po-npm/mappings/PurchaseOrder.jsonschema @@ -10,7 +10,7 @@ "title":"productName", "allOf":[ { - "$ref":"https://cdn.rawgit.com/highsource/jsonix/master/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/string" + "$ref":"http://www.jsonix.org/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/string" } ], "propertyType":"element", @@ -23,7 +23,7 @@ "title":"quantity", "allOf":[ { - "$ref":"https://cdn.rawgit.com/highsource/jsonix/master/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/int" + "$ref":"http://www.jsonix.org/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/int" } ], "propertyType":"element", @@ -36,7 +36,7 @@ "title":"usPrice", "allOf":[ { - "$ref":"https://cdn.rawgit.com/highsource/jsonix/master/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/decimal" + "$ref":"http://www.jsonix.org/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/decimal" } ], "propertyType":"element", @@ -49,7 +49,7 @@ "title":"comment", "allOf":[ { - "$ref":"https://cdn.rawgit.com/highsource/jsonix/master/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/string" + "$ref":"http://www.jsonix.org/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/string" } ], "propertyType":"element", @@ -62,7 +62,7 @@ "title":"shipDate", "allOf":[ { - "$ref":"https://cdn.rawgit.com/highsource/jsonix/master/jsonschemas/jsonix/Jsonix.jsonschema#/definitions/calendar" + "$ref":"http://www.jsonix.org/jsonschemas/jsonix/Jsonix.jsonschema#/definitions/calendar" } ], "propertyType":"element", @@ -75,7 +75,7 @@ "title":"partNum", "allOf":[ { - "$ref":"https://cdn.rawgit.com/highsource/jsonix/master/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/string" + "$ref":"http://www.jsonix.org/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/string" } ], "propertyType":"attribute", @@ -95,87 +95,34 @@ "partNum" ] }, - "PurchaseOrderType":{ + "Items":{ "type":"object", - "title":"PurchaseOrderType", + "title":"Items", "properties":{ - "shipTo":{ - "title":"shipTo", - "allOf":[ - { - "$ref":"#/definitions/USAddress" - } - ], - "propertyType":"element", - "elementName":{ - "localPart":"shipTo", - "namespaceURI":"" - } - }, - "billTo":{ - "title":"billTo", - "allOf":[ - { - "$ref":"#/definitions/USAddress" - } - ], - "propertyType":"element", - "elementName":{ - "localPart":"billTo", - "namespaceURI":"" - } - }, - "comment":{ - "title":"comment", - "allOf":[ - { - "$ref":"https://cdn.rawgit.com/highsource/jsonix/master/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/string" - } - ], - "propertyType":"element", - "elementName":{ - "localPart":"comment", - "namespaceURI":"" - } - }, - "items":{ - "title":"items", + "item":{ + "title":"item", "allOf":[ { - "$ref":"#/definitions/Items" + "type":"array", + "items":{ + "$ref":"#/definitions/Items.Item" + } } ], "propertyType":"element", "elementName":{ - "localPart":"items", - "namespaceURI":"" - } - }, - "orderDate":{ - "title":"orderDate", - "allOf":[ - { - "$ref":"https://cdn.rawgit.com/highsource/jsonix/master/jsonschemas/jsonix/Jsonix.jsonschema#/definitions/calendar" - } - ], - "propertyType":"attribute", - "attributeName":{ - "localPart":"orderDate", + "localPart":"item", "namespaceURI":"" } } }, "typeType":"classInfo", "typeName":{ - "localPart":"PurchaseOrderType", + "localPart":"Items", "namespaceURI":"" }, "propertiesOrder":[ - "shipTo", - "billTo", - "comment", - "items", - "orderDate" + "item" ] }, "USAddress":{ @@ -186,7 +133,7 @@ "title":"name", "allOf":[ { - "$ref":"https://cdn.rawgit.com/highsource/jsonix/master/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/string" + "$ref":"http://www.jsonix.org/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/string" } ], "propertyType":"element", @@ -199,7 +146,7 @@ "title":"street", "allOf":[ { - "$ref":"https://cdn.rawgit.com/highsource/jsonix/master/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/string" + "$ref":"http://www.jsonix.org/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/string" } ], "propertyType":"element", @@ -212,7 +159,7 @@ "title":"city", "allOf":[ { - "$ref":"https://cdn.rawgit.com/highsource/jsonix/master/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/string" + "$ref":"http://www.jsonix.org/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/string" } ], "propertyType":"element", @@ -225,7 +172,7 @@ "title":"state", "allOf":[ { - "$ref":"https://cdn.rawgit.com/highsource/jsonix/master/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/string" + "$ref":"http://www.jsonix.org/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/string" } ], "propertyType":"element", @@ -238,7 +185,7 @@ "title":"zip", "allOf":[ { - "$ref":"https://cdn.rawgit.com/highsource/jsonix/master/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/decimal" + "$ref":"http://www.jsonix.org/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/decimal" } ], "propertyType":"element", @@ -251,7 +198,7 @@ "title":"country", "allOf":[ { - "$ref":"https://cdn.rawgit.com/highsource/jsonix/master/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/string" + "$ref":"http://www.jsonix.org/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/string" } ], "propertyType":"attribute", @@ -275,34 +222,87 @@ "country" ] }, - "Items":{ + "PurchaseOrderType":{ "type":"object", - "title":"Items", + "title":"PurchaseOrderType", "properties":{ - "item":{ - "title":"item", + "shipTo":{ + "title":"shipTo", "allOf":[ { - "type":"array", - "items":{ - "$ref":"#/definitions/Items.Item" - } + "$ref":"#/definitions/USAddress" } ], "propertyType":"element", "elementName":{ - "localPart":"item", + "localPart":"shipTo", + "namespaceURI":"" + } + }, + "billTo":{ + "title":"billTo", + "allOf":[ + { + "$ref":"#/definitions/USAddress" + } + ], + "propertyType":"element", + "elementName":{ + "localPart":"billTo", + "namespaceURI":"" + } + }, + "comment":{ + "title":"comment", + "allOf":[ + { + "$ref":"http://www.jsonix.org/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/string" + } + ], + "propertyType":"element", + "elementName":{ + "localPart":"comment", + "namespaceURI":"" + } + }, + "items":{ + "title":"items", + "allOf":[ + { + "$ref":"#/definitions/Items" + } + ], + "propertyType":"element", + "elementName":{ + "localPart":"items", + "namespaceURI":"" + } + }, + "orderDate":{ + "title":"orderDate", + "allOf":[ + { + "$ref":"http://www.jsonix.org/jsonschemas/jsonix/Jsonix.jsonschema#/definitions/calendar" + } + ], + "propertyType":"attribute", + "attributeName":{ + "localPart":"orderDate", "namespaceURI":"" } } }, "typeType":"classInfo", "typeName":{ - "localPart":"Items", + "localPart":"PurchaseOrderType", "namespaceURI":"" }, "propertiesOrder":[ - "item" + "shipTo", + "billTo", + "comment", + "items", + "orderDate" ] } }, @@ -311,14 +311,14 @@ "type":"object", "properties":{ "name":{ - "$ref":"https://cdn.rawgit.com/highsource/jsonix/master/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/QName" + "$ref":"http://www.jsonix.org/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/QName" }, "value":{ - "$ref":"#/definitions/PurchaseOrderType" + "$ref":"http://www.jsonix.org/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/string" } }, "elementName":{ - "localPart":"purchaseOrder", + "localPart":"comment", "namespaceURI":"" } }, @@ -326,14 +326,14 @@ "type":"object", "properties":{ "name":{ - "$ref":"https://cdn.rawgit.com/highsource/jsonix/master/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/QName" + "$ref":"http://www.jsonix.org/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/QName" }, "value":{ - "$ref":"https://cdn.rawgit.com/highsource/jsonix/master/jsonschemas/w3c/2001/XMLSchema.jsonschema#/definitions/string" + "$ref":"#/definitions/PurchaseOrderType" } }, "elementName":{ - "localPart":"comment", + "localPart":"purchaseOrder", "namespaceURI":"" } } diff --git a/demos/po-npm/mappings/PurchaseOrder.standard.js b/demos/po-npm/mappings/PurchaseOrder.standard.js index bc4a13b..7132a94 100644 --- a/demos/po-npm/mappings/PurchaseOrder.standard.js +++ b/demos/po-npm/mappings/PurchaseOrder.standard.js @@ -40,37 +40,14 @@ var PurchaseOrder_Module_Factory = function () { type: 'attribute' }] }, { - localName: 'PurchaseOrderType', + localName: 'Items', propertyInfos: [{ - name: 'shipTo', - elementName: { - localPart: 'shipTo' - }, - typeInfo: '.USAddress' - }, { - name: 'billTo', - elementName: { - localPart: 'billTo' - }, - typeInfo: '.USAddress' - }, { - name: 'comment', - elementName: { - localPart: 'comment' - } - }, { - name: 'items', + name: 'item', + collection: true, elementName: { - localPart: 'items' - }, - typeInfo: '.Items' - }, { - name: 'orderDate', - typeInfo: 'Calendar', - attributeName: { - localPart: 'orderDate' + localPart: 'item' }, - type: 'attribute' + typeInfo: '.Items.Item' }] }, { localName: 'USAddress', @@ -108,25 +85,48 @@ var PurchaseOrder_Module_Factory = function () { type: 'attribute' }] }, { - localName: 'Items', + localName: 'PurchaseOrderType', propertyInfos: [{ - name: 'item', - collection: true, + name: 'shipTo', elementName: { - localPart: 'item' + localPart: 'shipTo' }, - typeInfo: '.Items.Item' + typeInfo: '.USAddress' + }, { + name: 'billTo', + elementName: { + localPart: 'billTo' + }, + typeInfo: '.USAddress' + }, { + name: 'comment', + elementName: { + localPart: 'comment' + } + }, { + name: 'items', + elementName: { + localPart: 'items' + }, + typeInfo: '.Items' + }, { + name: 'orderDate', + typeInfo: 'Calendar', + attributeName: { + localPart: 'orderDate' + }, + type: 'attribute' }] }], elementInfos: [{ + elementName: { + localPart: 'comment' + } + }, { elementName: { localPart: 'purchaseOrder' }, typeInfo: '.PurchaseOrderType' - }, { - elementName: { - localPart: 'comment' - } }] }; return {