├── .gitignore ├── LICENSE ├── README.md ├── bower.json ├── demos ├── po │ ├── .gitignore │ ├── pom.xml │ └── src │ │ └── main │ │ ├── resources │ │ ├── bindings.xjb │ │ └── purchaseorder.xsd │ │ └── webapp │ │ ├── WEB-INF │ │ └── web.xml │ │ ├── index.html │ │ ├── js │ │ ├── .gitignore │ │ ├── main.js │ │ └── require.js │ │ └── po.xml ├── pom.xml ├── src │ └── main │ │ └── resources │ │ └── .placeholder └── wms │ ├── .gitignore │ ├── pom.xml │ └── src │ ├── main │ ├── resources │ │ ├── binding.xjb │ │ ├── wms │ │ │ └── 1.3.0 │ │ │ │ ├── ReadMe.txt │ │ │ │ ├── capabilities_1_3_0.xml │ │ │ │ ├── capabilities_1_3_0.xsd │ │ │ │ ├── exceptions_1_3_0.xml │ │ │ │ └── exceptions_1_3_0.xsd │ │ └── xlink │ │ │ └── 1.0.0 │ │ │ ├── ReadMe.txt │ │ │ └── xlinks.xsd │ └── webapp │ │ ├── WEB-INF │ │ ├── web.properties │ │ └── web.xml │ │ ├── index.html │ │ └── js │ │ └── .gitignore │ └── test │ └── java │ └── org │ └── hisrc │ └── jsonix │ └── demos │ └── wms │ └── StartJsonixDemoWms.java ├── dist ├── .gitignore ├── Jsonix-all.js ├── Jsonix-min.js └── pom.xml ├── docs └── Jsonix.pdf ├── fiddles ├── 6skd7x8u │ ├── GetRecords-optimized.js │ └── GetRecords-original.js ├── po │ └── demo.response.xml ├── q18ej0td │ └── GetCapabilities.xml └── yq8x0oqf │ └── GetRecords.xml ├── formats ├── gml-geojson │ ├── .gitignore │ ├── pom.xml │ └── src │ │ ├── etc │ │ └── header.txt │ │ ├── main │ │ ├── javascript │ │ │ └── org │ │ │ │ └── hisrc │ │ │ │ └── jsonix │ │ │ │ └── gml │ │ │ │ └── v_3_1_1 │ │ │ │ ├── GeoJSON.js │ │ │ │ └── GeoJSON │ │ │ │ ├── AbstractForwardGeometryConverter.js │ │ │ │ ├── AbstractInverseGeometryConverter.js │ │ │ │ ├── ForwardCoordinateConverter.js │ │ │ │ ├── ForwardGeometryConverter.js │ │ │ │ ├── ForwardLineStringConverter.js │ │ │ │ ├── ForwardLinearRingConverter.js │ │ │ │ ├── ForwardMultiGeometryConverter.js │ │ │ │ ├── ForwardMultiLineStringConverter.js │ │ │ │ ├── ForwardMultiPointConverter.js │ │ │ │ ├── ForwardMultiPolygonConverter.js │ │ │ │ ├── ForwardPointConverter.js │ │ │ │ ├── ForwardPolygonConverter.js │ │ │ │ ├── GeometryAdapter.js │ │ │ │ ├── InverseCoordinateConverter.js │ │ │ │ ├── InverseGeometryConverter.js │ │ │ │ ├── InverseLineStringConverter.js │ │ │ │ ├── InverseLinearRingConverter.js │ │ │ │ ├── InverseMultiGeometryConverter.js │ │ │ │ ├── InverseMultiLineStringConverter.js │ │ │ │ ├── InverseMultiPointConverter.js │ │ │ │ ├── InverseMultiPolygonConverter.js │ │ │ │ ├── InversePointConverter.js │ │ │ │ └── InversePolygonConverter.js │ │ └── resources │ │ │ ├── binding.xjb │ │ │ ├── gml │ │ │ └── 3.1.1 │ │ │ │ └── profiles │ │ │ │ └── gmlsfprofile │ │ │ │ └── 1.0.0 │ │ │ │ ├── gmlsf.xsd │ │ │ │ └── gmlsf2.xsd │ │ │ ├── org │ │ │ └── hisrc │ │ │ │ └── jsonix │ │ │ │ └── gml │ │ │ │ └── v_3_1_1 │ │ │ │ └── GeoJSON.scripts │ │ │ ├── schema.xsd │ │ │ └── xlink │ │ │ └── 1.0.0 │ │ │ ├── ReadMe.txt │ │ │ └── xlinks.xsd │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── hisrc │ │ │ └── jsonix │ │ │ └── gml │ │ │ └── v_3_1_1 │ │ │ └── geojson │ │ │ └── tests │ │ │ └── GML311GeoJSONTest.java │ │ ├── javascript │ │ └── org │ │ │ └── hisrc │ │ │ └── jsonix │ │ │ └── gml │ │ │ └── v_3_1_1 │ │ │ └── geojson │ │ │ └── tests │ │ │ ├── GML311GeoJSONTest.js │ │ │ ├── GML311GeoJSONTest.scripts │ │ │ └── GML311GeoJSONTest.test.scripts │ │ └── resources │ │ ├── log4j.properties │ │ └── org │ │ └── hisrc │ │ └── jsonix │ │ └── gml │ │ └── v_3_1_1 │ │ └── geojson │ │ └── tests │ │ ├── LineString0.xml │ │ ├── LineString1.xml │ │ ├── LineString2.xml │ │ ├── LineString3.xml │ │ ├── LinearRing0.xml │ │ ├── LinearRing1.xml │ │ ├── MultiGeometry0.xml │ │ ├── MultiGeometry1.xml │ │ ├── MultiLineString0.xml │ │ ├── MultiPoint0.xml │ │ ├── MultiPoint1.xml │ │ ├── MultiPolygon0.xml │ │ ├── MultiPolygon1.xml │ │ ├── Point0.xml │ │ ├── Point1.xml │ │ ├── Point2.xml │ │ ├── Point3.xml │ │ ├── Point4.xml │ │ ├── Point5.xml │ │ ├── Polygon0.xml │ │ ├── Polygon1.xml │ │ └── Polygon2.xml ├── pom.xml └── src │ └── main │ └── resources │ └── .placeholder ├── full-build-1.8.bat ├── images └── logo_WebStorm.png ├── install.bat ├── nodejs ├── demos │ ├── fossgis2015 │ │ └── wms-01 │ │ │ ├── .gitignore │ │ │ ├── bindings │ │ │ ├── wms-v_1_3_0.jsonix.xjb │ │ │ ├── wms-v_1_3_0.xjb │ │ │ └── xlink-v_1_0.xjb │ │ │ ├── mappings │ │ │ └── WMS_1_3_0_Full.js │ │ │ ├── package.json │ │ │ └── schemas │ │ │ ├── catalog.cat │ │ │ ├── ogc │ │ │ └── wms │ │ │ │ └── 1.3.0 │ │ │ │ ├── capabilities_1_3_0.xsd │ │ │ │ └── exceptions_1_3_0.xsd │ │ │ └── w3c │ │ │ ├── 1999 │ │ │ └── xlink.xsd │ │ │ └── 2001 │ │ │ ├── XMLSchema.dtd │ │ │ ├── XMLSchema.xsd │ │ │ └── xml.xsd │ └── user │ │ ├── .gitignore │ │ ├── jsonix-demo-user.js │ │ ├── package.json │ │ └── tests │ │ ├── sample01.xml │ │ ├── tests.js │ │ └── user-tests.js ├── pom.xml ├── scripts │ ├── .gitignore │ ├── .npmignore │ ├── README.md │ ├── jsonix.js │ ├── jsonschemas │ │ ├── jsonix │ │ │ └── Jsonix.jsonschema │ │ └── w3c │ │ │ └── 2001 │ │ │ └── XMLSchema.jsonschema │ ├── lib │ │ ├── .gitignore │ │ └── .npmignore │ ├── package-lock.json │ ├── package.json │ ├── pom.xml │ ├── src │ │ └── main │ │ │ └── npm │ │ │ └── package.json │ └── tests │ │ ├── GH111 │ │ ├── GH111.js │ │ └── Mappings.js │ │ ├── GH135 │ │ ├── A.js │ │ ├── B.js │ │ └── GH135.js │ │ ├── GH141 │ │ └── GH141.js │ │ ├── GH150 │ │ ├── A.js │ │ ├── B.js │ │ └── GH150.js │ │ ├── GH56 │ │ ├── GH56.js │ │ ├── Mappings.js │ │ ├── anyAttribute-0.simplified.json │ │ ├── anyAttribute-0.standard.json │ │ ├── anyAttribute-0.xml │ │ ├── anyElementLax-0.simplified.json │ │ ├── anyElementLax-0.standard.json │ │ ├── anyElementLax-0.xml │ │ ├── attribute-0.simplified.json │ │ ├── attribute-0.standard.json │ │ ├── attribute-0.xml │ │ ├── base-0.simplified.json │ │ ├── base-0.standard.json │ │ ├── base-0.xml │ │ ├── element-0.simplified.json │ │ ├── element-0.standard.json │ │ ├── element-0.xml │ │ ├── element-1.simplified.json │ │ ├── element-1.standard.json │ │ ├── element-1.xml │ │ ├── elementMap-0.simplified.json │ │ ├── elementMap-0.standard.json │ │ ├── elementMap-0.xml │ │ ├── elementMap-1.simplified.json │ │ ├── elementMap-1.standard.json │ │ ├── elementMap-1.xml │ │ ├── elementRef-0.simplified.json │ │ ├── elementRef-0.standard.json │ │ ├── elementRef-0.xml │ │ ├── elementRef-1.simplified.json │ │ ├── elementRef-1.standard.json │ │ ├── elementRef-1.xml │ │ ├── elementRefMixed-0.simplified.json │ │ ├── elementRefMixed-0.standard.json │ │ ├── elementRefMixed-0.xml │ │ ├── elementRefs-0.simplified.json │ │ ├── elementRefs-0.standard.json │ │ ├── elementRefs-0.xml │ │ ├── elements-0.simplified.json │ │ ├── elements-0.standard.json │ │ ├── elements-0.xml │ │ ├── elements-1.simplified.json │ │ ├── elements-1.standard.json │ │ ├── elements-1.xml │ │ ├── extended-0.simplified.json │ │ ├── extended-0.standard.json │ │ ├── extended-0.xml │ │ ├── extendedExtended-0.simplified.json │ │ ├── extendedExtended-0.standard.json │ │ ├── extendedExtended-0.xml │ │ ├── ns │ │ │ ├── anyAttribute-1.simplified.json │ │ │ ├── anyAttribute-1.standard.json │ │ │ └── anyAttribute-1.xml │ │ ├── simpleTypes-0.simplified.json │ │ ├── simpleTypes-0.standard.json │ │ ├── simpleTypes-0.xml │ │ ├── string-0.simplified.json │ │ ├── string-0.standard.json │ │ ├── string-0.xml │ │ ├── value-0.simplified.json │ │ ├── value-0.standard.json │ │ └── value-0.xml │ │ ├── GH61 │ │ ├── GH61.js │ │ └── Mappings.js │ │ ├── GH62 │ │ ├── GH62.js │ │ └── Mappings.js │ │ ├── GH70 │ │ ├── GH70.js │ │ └── Mappings.js │ │ ├── GH71 │ │ ├── GH71.js │ │ └── Mappings.js │ │ ├── GH73 │ │ ├── GH73.js │ │ ├── GH73Calendar.js │ │ ├── GH73Core.js │ │ ├── GH73GDay.js │ │ ├── GH73GMonth.js │ │ ├── GH73GMonthDay.js │ │ ├── GH73GYear.js │ │ ├── GH73GYearMonth.js │ │ ├── GH73Regex.js │ │ └── Mappings.js │ │ ├── GH83 │ │ ├── GH83.js │ │ ├── ground.js │ │ ├── ground.json │ │ └── ground.xml │ │ ├── GH96 │ │ ├── GH96.js │ │ ├── test_any.js │ │ ├── test_any.json │ │ ├── test_any.xml │ │ └── test_any.xsd │ │ ├── comparison.js │ │ ├── forEachResourceInDirectory.js │ │ ├── fs.js │ │ ├── issues.js │ │ ├── nodejs.js │ │ ├── request.js │ │ ├── roundtrip.js │ │ ├── sax.js │ │ ├── schema.js │ │ ├── test0.xml │ │ ├── test1.xml │ │ ├── tests.js │ │ ├── util.js │ │ ├── xml.js │ │ └── xsd.js └── tests │ ├── ar │ ├── .gitignore │ ├── AR.js │ ├── ar.xsd │ ├── jsonix-tests-ar.js │ ├── package-lock.json │ ├── package.json │ ├── pom.xml │ └── tests │ │ ├── ar-tests.js │ │ ├── sample01.xml │ │ └── tests.js │ ├── basic │ ├── .gitignore │ ├── README.md │ ├── jsonix-tests-basic.js │ ├── package-lock.json │ ├── package.json │ ├── pom.xml │ └── tests │ │ ├── One │ │ └── Mappings.js │ │ ├── PO │ │ ├── Mappings.js │ │ └── po-0.xml │ │ ├── Two │ │ ├── Data.js │ │ ├── Mappings.js │ │ ├── attribute-0.xml │ │ ├── customClassValue-0.xml │ │ ├── element-0.xml │ │ ├── string-0.xml │ │ └── value-0.xml │ │ ├── XMLNS │ │ └── Mappings.js │ │ ├── Zero │ │ ├── Data.js │ │ ├── Mappings.js │ │ ├── anyAttribute-0.xml │ │ ├── anyElementLax-0.xml │ │ ├── anyElementLax-1.xml │ │ ├── attribute-0.xml │ │ ├── attribute-1.xml │ │ ├── base-0.xml │ │ ├── element-0.xml │ │ ├── elementRef-0.xml │ │ ├── elementRef-1.xml │ │ ├── elementRefMixed-0.xml │ │ ├── elementRefs-0.xml │ │ ├── elements-0.xml │ │ ├── extended-0.xml │ │ ├── extendedExtended-0.xml │ │ ├── simpleTypes-0.xml │ │ ├── string-0.xml │ │ └── value-0.xml │ │ ├── gh48.js │ │ ├── gh56.js │ │ ├── one.js │ │ ├── po.js │ │ ├── tests.js │ │ ├── two.js │ │ ├── xmlns.js │ │ └── zero.js │ ├── browserify │ ├── .gitignore │ ├── README.md │ ├── bindings.xjb │ ├── index.html │ ├── main.js │ ├── package-lock.json │ ├── package.json │ ├── po.xml │ ├── pom.xml │ └── purchaseorder.xsd │ ├── po │ ├── .gitignore │ ├── README.md │ ├── bindings.xjb │ ├── jsonix-tests-po.js │ ├── mappings │ │ └── .gitignore │ ├── package-lock.json │ ├── package.json │ ├── pom.xml │ ├── purchaseorder.xsd │ └── tests │ │ ├── po-tests.js │ │ ├── po.json │ │ ├── po.xml │ │ └── tests.js │ ├── pom.xml │ └── wps │ ├── .gitignore │ ├── README.md │ ├── bindings │ └── bindings.xjb │ ├── catalog │ └── catalog.cat │ ├── mappings │ └── .gitignore │ ├── package-lock.json │ ├── package.json │ ├── pom.xml │ ├── schemas │ ├── ogc │ │ ├── ows │ │ │ ├── 1.1.0 │ │ │ │ ├── Examples │ │ │ │ │ ├── exampleCapabilities.xsd │ │ │ │ │ ├── exampleCapabilities1.xml │ │ │ │ │ ├── exampleConstraint1.xml │ │ │ │ │ ├── exampleExceptionReport1.xml │ │ │ │ │ ├── exampleExceptionReport2.xml │ │ │ │ │ ├── exampleGeneralBox2.xml │ │ │ │ │ ├── exampleGetCapabilities2.xml │ │ │ │ │ ├── exampleOperationsMetadata.xml │ │ │ │ │ └── exampleWGS84Box2.xml │ │ │ │ ├── ows19115subset.xsd │ │ │ │ ├── owsAll.xsd │ │ │ │ ├── owsCommon.xsd │ │ │ │ ├── owsContents.xsd │ │ │ │ ├── owsDataIdentification.xsd │ │ │ │ ├── owsDomainType.xsd │ │ │ │ ├── owsExceptionReport.xsd │ │ │ │ ├── owsGetCapabilities.xsd │ │ │ │ ├── owsGetResourceByID.xsd │ │ │ │ ├── owsInputOutputData.xsd │ │ │ │ ├── owsManifest.xsd │ │ │ │ ├── owsOperationsMetadata.xsd │ │ │ │ ├── owsServiceIdentification.xsd │ │ │ │ └── owsServiceProvider.xsd │ │ │ └── ReadMe.txt │ │ └── wps │ │ │ ├── 1.0.0 │ │ │ ├── common │ │ │ │ ├── DescriptionType.xsd │ │ │ │ ├── ProcessBriefType.xsd │ │ │ │ ├── ProcessVersion.xsd │ │ │ │ ├── RequestBaseType.xsd │ │ │ │ ├── ResponseBaseType.xsd │ │ │ │ └── WSDL.xsd │ │ │ ├── examples │ │ │ │ ├── 10_wpsGetCapabilities_request.xml │ │ │ │ ├── 10_wpsGetCapabilities_request_SOAP.xml │ │ │ │ ├── 20_wpsGetCapabilities_response.xml │ │ │ │ ├── 20_wpsGetCapabilities_response_SOAP.xml │ │ │ │ ├── 30_wpsDescribeProcess_request.xml │ │ │ │ ├── 30_wpsDescribeProcess_request_SOAP.xml │ │ │ │ ├── 40_wpsDescribeProcess_response-extended.xml │ │ │ │ ├── 40_wpsDescribeProcess_response.xml │ │ │ │ ├── 50_wpsExecute_request_RawDataOutput.xml │ │ │ │ ├── 51_wpsExecute_request-extended_ResponseDocument.xml │ │ │ │ ├── 51_wpsExecute_request_ResponseDocument.xml │ │ │ │ ├── 52_wpsExecute_request_ResponseDocument.xml │ │ │ │ ├── 53_wpsExecute_request_ComplexValue.xml │ │ │ │ ├── 62_wpsExecute_response.xml │ │ │ │ ├── 90_wpsExceptionReport.xml │ │ │ │ ├── MyComplexValueSchema.xsd │ │ │ │ └── example_service.wsdl │ │ │ ├── wpsAll.xsd │ │ │ ├── wpsDescribeProcess_request.xsd │ │ │ ├── wpsDescribeProcess_response.xsd │ │ │ ├── wpsExecute_request.xsd │ │ │ ├── wpsExecute_response.xsd │ │ │ ├── wpsGetCapabilities_request.xsd │ │ │ └── wpsGetCapabilities_response.xsd │ │ │ └── ReadMe.txt │ └── w3c │ │ ├── 1999 │ │ └── xlink.xsd │ │ └── 2001 │ │ └── xml.xsd │ └── tests │ ├── execute-01.xml │ ├── tests.js │ └── wps-tests.js ├── pom.xml ├── qrelease.bat ├── release.bat ├── scripts ├── .gitignore ├── JsTestDriver.jar ├── jsTestDriver.conf ├── pom.xml ├── server.bat ├── src │ ├── etc │ │ └── header.txt │ ├── main │ │ ├── assembly │ │ │ └── scripts.xml │ │ ├── java │ │ │ └── org │ │ │ │ └── hisrc │ │ │ │ └── jsonix │ │ │ │ └── JsonixScriptsConstants.java │ │ ├── javascript │ │ │ └── org │ │ │ │ └── hisrc │ │ │ │ └── jsonix │ │ │ │ ├── Jsonix.js │ │ │ │ └── Jsonix │ │ │ │ ├── Binding.js │ │ │ │ ├── Binding │ │ │ │ ├── Marshaller.js │ │ │ │ ├── Marshalls.js │ │ │ │ ├── Unmarshaller.js │ │ │ │ └── Unmarshalls.js │ │ │ │ ├── Class.js │ │ │ │ ├── Context.js │ │ │ │ ├── DOM.js │ │ │ │ ├── Jsonix.footer.fragmentjs │ │ │ │ ├── Jsonix.header.fragmentjs │ │ │ │ ├── Mapping.js │ │ │ │ ├── Mapping │ │ │ │ ├── Style.js │ │ │ │ ├── Style │ │ │ │ │ ├── Simplified.js │ │ │ │ │ └── Standard.js │ │ │ │ └── Styled.js │ │ │ │ ├── Model.js │ │ │ │ ├── Model │ │ │ │ ├── AbstractElementRefsPropertyInfo.js │ │ │ │ ├── AbstractElementsPropertyInfo.js │ │ │ │ ├── AnyAttributePropertyInfo.js │ │ │ │ ├── AnyElementPropertyInfo.js │ │ │ │ ├── AttributePropertyInfo.js │ │ │ │ ├── ClassInfo.js │ │ │ │ ├── ElementInfo.js │ │ │ │ ├── ElementMapPropertyInfo.js │ │ │ │ ├── ElementPropertyInfo.js │ │ │ │ ├── ElementRefPropertyInfo.js │ │ │ │ ├── ElementRefsPropertyInfo.js │ │ │ │ ├── ElementsPropertyInfo.js │ │ │ │ ├── EnumLeafInfo.js │ │ │ │ ├── Module.js │ │ │ │ ├── PropertyInfo.js │ │ │ │ ├── SingleTypePropertyInfo.js │ │ │ │ ├── TypeInfo.js │ │ │ │ └── ValuePropertyInfo.js │ │ │ │ ├── Request.js │ │ │ │ ├── Schema.js │ │ │ │ ├── Schema │ │ │ │ ├── XSD.js │ │ │ │ ├── XSD │ │ │ │ │ ├── AnySimpleType.js │ │ │ │ │ ├── AnyType.js │ │ │ │ │ ├── AnyURI.js │ │ │ │ │ ├── Base64Binary.js │ │ │ │ │ ├── Boolean.js │ │ │ │ │ ├── Byte.js │ │ │ │ │ ├── Calendar.js │ │ │ │ │ ├── Date.js │ │ │ │ │ ├── DateAsDate.js │ │ │ │ │ ├── DateTime.js │ │ │ │ │ ├── DateTimeAsDate.js │ │ │ │ │ ├── Decimal.js │ │ │ │ │ ├── Double.js │ │ │ │ │ ├── Duration.js │ │ │ │ │ ├── Float.js │ │ │ │ │ ├── GDay.js │ │ │ │ │ ├── GMonth.js │ │ │ │ │ ├── GMonthDay.js │ │ │ │ │ ├── GYear.js │ │ │ │ │ ├── GYearMonth.js │ │ │ │ │ ├── HexBinary.js │ │ │ │ │ ├── ID.js │ │ │ │ │ ├── IDREF.js │ │ │ │ │ ├── IDREFS.js │ │ │ │ │ ├── Int.js │ │ │ │ │ ├── Integer.js │ │ │ │ │ ├── Language.js │ │ │ │ │ ├── List.js │ │ │ │ │ ├── Long.js │ │ │ │ │ ├── NCName.js │ │ │ │ │ ├── NMToken.js │ │ │ │ │ ├── NMTokens.js │ │ │ │ │ ├── Name.js │ │ │ │ │ ├── NegativeInteger.js │ │ │ │ │ ├── NonNegativeInteger.js │ │ │ │ │ ├── NonPositiveInteger.js │ │ │ │ │ ├── NormalizedString.js │ │ │ │ │ ├── Number.js │ │ │ │ │ ├── PositiveInteger.js │ │ │ │ │ ├── QName.js │ │ │ │ │ ├── Short.js │ │ │ │ │ ├── String.js │ │ │ │ │ ├── Strings.js │ │ │ │ │ ├── Time.js │ │ │ │ │ ├── TimeAsDate.js │ │ │ │ │ ├── Token.js │ │ │ │ │ ├── UnsignedByte.js │ │ │ │ │ ├── UnsignedInt.js │ │ │ │ │ ├── UnsignedLong.js │ │ │ │ │ └── UnsignedShort.js │ │ │ │ └── XSI.js │ │ │ │ ├── SingleFile.js │ │ │ │ ├── Util.js │ │ │ │ ├── Util │ │ │ │ ├── Ensure.js │ │ │ │ ├── NumberUtils.js │ │ │ │ ├── StringUtils.js │ │ │ │ └── Type.js │ │ │ │ ├── XML.js │ │ │ │ └── XML │ │ │ │ ├── Calendar.js │ │ │ │ ├── Input.js │ │ │ │ ├── Output.js │ │ │ │ └── QName.js │ │ ├── resources │ │ │ └── org │ │ │ │ └── hisrc │ │ │ │ └── jsonix │ │ │ │ ├── Footer.scripts │ │ │ │ ├── Header.scripts │ │ │ │ ├── Jsonix.complete.scripts │ │ │ │ ├── Jsonix.scripts │ │ │ │ └── SingleFile.scripts │ │ └── webapp │ │ │ └── xmlns.html │ └── test │ │ ├── java │ │ └── org │ │ │ └── hisrc │ │ │ └── jsonix │ │ │ ├── samples │ │ │ └── test │ │ │ │ ├── SamplesAllTest.java │ │ │ │ ├── SamplesMinTest.java │ │ │ │ └── SamplesTest.java │ │ │ ├── test │ │ │ └── JsonixTest.java │ │ │ └── xml │ │ │ ├── bind │ │ │ └── test │ │ │ │ └── CalendarTest.java │ │ │ └── datatype │ │ │ └── test │ │ │ ├── GTypesTest.java │ │ │ └── GTypesType.java │ │ ├── javascript │ │ ├── net │ │ │ └── opengis │ │ │ │ └── wps │ │ │ │ └── v_1_0_0 │ │ │ │ ├── WPSTests.js │ │ │ │ └── WPS_V_1_0_0.js │ │ └── org │ │ │ └── hisrc │ │ │ └── jsonix │ │ │ ├── samples │ │ │ ├── five │ │ │ │ ├── Five.js │ │ │ │ └── test │ │ │ │ │ └── FiveTest.js │ │ │ ├── one │ │ │ │ ├── One.js │ │ │ │ └── test │ │ │ │ │ └── OneTest.js │ │ │ ├── po │ │ │ │ ├── PO.js │ │ │ │ └── test │ │ │ │ │ └── POTest.js │ │ │ ├── test │ │ │ │ ├── SamplesAllTest.scripts │ │ │ │ ├── SamplesMinTest.scripts │ │ │ │ ├── SamplesTest.scripts │ │ │ │ └── SamplesTest.test.scripts │ │ │ └── three │ │ │ │ ├── Three.js │ │ │ │ └── test │ │ │ │ └── ThreeTest.js │ │ │ └── test │ │ │ ├── JsonixContextTest.js │ │ │ ├── JsonixRequestTest.js │ │ │ ├── JsonixSchemaXSDTest.js │ │ │ ├── JsonixTest.js │ │ │ ├── JsonixTest.jstd.js │ │ │ ├── JsonixTest.scripts │ │ │ ├── JsonixTest.test.scripts │ │ │ ├── JsonixUtilTest.js │ │ │ ├── JsonixXMLInputTest.jstd.js │ │ │ └── JsonixXMLTest.js │ │ └── resources │ │ ├── log4j.properties │ │ ├── net │ │ └── opengis │ │ │ └── wps │ │ │ └── v_1_0_0 │ │ │ └── GetCapabilities[0].xml │ │ └── org │ │ └── hisrc │ │ └── jsonix │ │ ├── samples │ │ └── po │ │ │ └── test │ │ │ └── po-0.xml │ │ └── test │ │ ├── JsonixTest.xhtml │ │ └── test0.xml └── test.bat ├── setversion.bat ├── short-build.bat ├── src └── main │ ├── bower │ └── bower.json │ └── eclipse │ └── eclipse-code-formatter.xml └── typescript ├── README.md ├── pom.xml ├── readme_de.md └── src └── main ├── java └── org │ └── hisrc │ └── jsonix │ ├── Binding │ ├── Mashalls │ │ └── Element.java │ └── Unmashalls │ │ └── Element.java │ ├── Mapping │ └── Styled.java │ ├── Model │ ├── AbstractElementRefsPropertyInfo.java │ ├── AbstractElementsPropertyInfo.java │ ├── AnyAttributePropertyInfo.java │ ├── AnyElementPropertyInfo.java │ ├── AttributePropertyInfo.java │ ├── ClassInfo.java │ ├── ElementInfo.java │ ├── ElementMapPropertyInfo.java │ ├── ElementPropertyInfo.java │ ├── ElementRefPropertyInfo.java │ ├── ElementRefsPropertyInfo.java │ ├── ElementsPropertyInfo.java │ ├── EnumLeafInfo.java │ ├── Module.java │ ├── PropertyInfo.java │ ├── SingleTypePropertyInfo.java │ ├── TypeInfo.java │ └── ValuePropertyInfo.java │ └── Schema │ └── XML │ └── QName.java ├── resources ├── diagram.svg └── model.uml └── typescript └── Jsonix.d.ts /.gitignore: -------------------------------------------------------------------------------- 1 | .project 2 | .settings 3 | target 4 | .tern-project 5 | .*~ 6 | *~ 7 | .idea 8 | /bin/ 9 | *.iml 10 | .classpath 11 | rm_ide_settings.sh 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, Alexey Valikov. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | 25 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jsonix", 3 | "version": "3.0.1-SNAPSHOT", 4 | "homepage": "https://github.com/highsource/jsonix", 5 | "authors": [ 6 | "Alexey Valikov" 7 | ], 8 | "description": "Jsonix (JSON interfaces for XML) is a JavaScript library which allows converting between XML and JSON structures.", 9 | "main": "dist/Jsonix-all.js", 10 | "keywords" : [ "json", "xml", "unmarshal", "unmarshalling", "marshal", 11 | "marshalling", "parse", "parsing", "serialize", "serializing", 12 | "javascript objects", "dom", "util", "utility", "jaxb", "jsonix" ], 13 | "license": "BSD-3-Clause", 14 | "ignore": [ "**/.*", "tests", "README.md", "node_modules", "compiler", "demos", 15 | "docs", "fiddles", "formats", "full", "misc", "nodejs", "pom.xml", 16 | "release.bat", "samples", "scripts", "src" ] 17 | } 18 | -------------------------------------------------------------------------------- /demos/po/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /demos/po/src/main/resources/bindings.xjb: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /demos/po/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | Jsonix Demo [po] 13 | 14 | -------------------------------------------------------------------------------- /demos/po/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

Purchase order from

7 | 8 |

Please see po.xml.

9 | 10 |

Shipping address

11 | 12 |
13 |
Name
14 |
15 |
Street
16 |
17 |
City
18 |
19 |
State
20 |
21 |
Country
22 |
23 |
24 | 25 |

Billing address

26 | 27 |
28 |
Name
29 |
30 |
Street
31 |
32 |
City
33 |
34 |
State
35 |
36 |
Country
37 |
38 |
39 | 40 |

Purchase details

41 | 42 |
43 |
Number of items
44 |
45 |
Total price
46 |
47 |
48 | 49 | 50 | 56 | 57 | -------------------------------------------------------------------------------- /demos/po/src/main/webapp/js/.gitignore: -------------------------------------------------------------------------------- 1 | /Jsonix-all.js 2 | /PO.js 3 | -------------------------------------------------------------------------------- /demos/po/src/main/webapp/po.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Alice Smith 4 | 123 Maple Street 5 | Mill Valley 6 | CA 7 | 90952 8 | 9 | 10 | Robert Smith 11 | 8 Oak Avenue 12 | Old Town 13 | PA 14 | 95819 15 | 16 | Hurry, my lawn is going wild! 17 | 18 | 19 | Lawnmower 20 | 1 21 | 148.95 22 | Confirm this is electric 23 | 24 | 25 | Baby Monitor 26 | 1 27 | 39.98 28 | 1999-05-21 29 | 30 | 31 | -------------------------------------------------------------------------------- /demos/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | jsonix-demos 4 | pom 5 | Jsonix Demos 6 | 7 | org.hisrc.jsonix 8 | jsonix-project 9 | 2.1.2 10 | 11 | 12 | po 13 | wms 14 | 15 | 16 | 17 | 18 | org.apache.maven.plugins 19 | maven-deploy-plugin 20 | 21 | true 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /demos/src/main/resources/.placeholder: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highsource/jsonix/5d0d101f338bcf514bb6249437860e4b4d011cd2/demos/src/main/resources/.placeholder -------------------------------------------------------------------------------- /demos/wms/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /demos/wms/src/main/resources/binding.xjb: -------------------------------------------------------------------------------- 1 | 6 | 8 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /demos/wms/src/main/resources/wms/1.3.0/ReadMe.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highsource/jsonix/5d0d101f338bcf514bb6249437860e4b4d011cd2/demos/wms/src/main/resources/wms/1.3.0/ReadMe.txt -------------------------------------------------------------------------------- /demos/wms/src/main/resources/wms/1.3.0/exceptions_1_3_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | Plain text message about an error. 8 | 9 | 10 | Another error message, this one with a service exception code supplied. 11 | 12 | 13 | , line 42 15 | 16 | A message that includes angle brackets in text 17 | must be enclosed in a Character Data Section 18 | as in this example. All XML-like markup is 19 | ignored except for this sequence of three 20 | closing characters: 21 | ]]> 22 | 23 | 24 | foo.c 26 | An error occurred 27 | Similarly, actual XML 28 | can be enclosed in a CDATA section. 29 | A generic parser will ignore that XML, 30 | but application-specific software may choose 31 | to process it. 32 | ]]> 33 | 34 | 35 | -------------------------------------------------------------------------------- /demos/wms/src/main/resources/wms/1.3.0/exceptions_1_3_0.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /demos/wms/src/main/resources/xlink/1.0.0/ReadMe.txt: -------------------------------------------------------------------------------- 1 | This XML Schema Document named xlinks.xsd has been stored here based 2 | on the change request: 3 | OGC 05-068r1 "Store xlinks.xsd file at a fixed location" 4 | 5 | Arliss Whiteside, 2005-11-22 6 | 7 | -------------------------------------------------------------------------------- /demos/wms/src/main/webapp/WEB-INF/web.properties: -------------------------------------------------------------------------------- 1 | webapp.host=localhost 2 | webapp.port=8181 3 | webapp.context=jsonix-demos-wms 4 | webapp.home=${baseDir}/src/main/webapp -------------------------------------------------------------------------------- /demos/wms/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | Jsonix Demo [wms] 13 | 14 | 15 | net.disy.legato.tools.servlet.ProxyServlet 16 | net.disy.legato.tools.servlet.ProxyServlet 17 | 18 | allowedUrls 19 | 20 | 21 | http://www2.demis.nl 22 | 23 | 24 | 25 | 26 | 27 | net.disy.legato.tools.servlet.ProxyServlet 28 | /servlet/proxy 29 | 30 | 31 | -------------------------------------------------------------------------------- /demos/wms/src/main/webapp/js/.gitignore: -------------------------------------------------------------------------------- 1 | /Jsonix-all.js 2 | /WMS_V_1_3_0.js -------------------------------------------------------------------------------- /demos/wms/src/test/java/org/hisrc/jsonix/demos/wms/StartJsonixDemoWms.java: -------------------------------------------------------------------------------- 1 | package org.hisrc.jsonix.demos.wms; 2 | 3 | import net.disy.legato.testing.server.testing.AbstractJettyRunWebServerEnvironment; 4 | 5 | public class StartJsonixDemoWms extends AbstractJettyRunWebServerEnvironment { 6 | 7 | @Override 8 | public String getPropertiesFileName() { 9 | return "src/main/webapp/WEB-INF/web.properties"; 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /dist/.gitignore: -------------------------------------------------------------------------------- 1 | target -------------------------------------------------------------------------------- /docs/Jsonix.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highsource/jsonix/5d0d101f338bcf514bb6249437860e4b4d011cd2/docs/Jsonix.pdf -------------------------------------------------------------------------------- /fiddles/6skd7x8u/GetRecords-optimized.js: -------------------------------------------------------------------------------- 1 | var data = { 2 | "csw:GetRecords" : { "maxRecords" : 10, "resultType" : "results", "service" : "CSW", "version" : "2.0.2", 3 | "abstractQuery" : { 4 | "csw:Query" : { "typeNames" : [ "csw:Record", ], 5 | "elementSetName" : "full", 6 | "constraint" : { "version" : "1.1.0", 7 | "filter" : { 8 | "ogc:Filter" : { 9 | "logicOps" : { 10 | "ogc:And" : { 11 | "comparisonOpsOrSpatialOpsOrLogicOps" : [ { 12 | "ogc:BBOX" : { 13 | "propertyName" : "ows:BoundingBox", 14 | "envelope" : { 15 | "gml:Envelope" : { "srsName" : "urn:x-ogc:def:crs:EPSG:6.11:4326", 16 | "lowerCorner" : [ -80, 150 ], 17 | "upperCorner" : [ 80, -150 ] 18 | } 19 | } 20 | } 21 | }, { 22 | "ogc:PropertyIsLike" : { "escapeChar" : "\\", "singleChar" : "_", "wildCard" : "%", 23 | "propertyName" : "dc:title", 24 | "literal" : [ "%WATER DEPTH%" ] 25 | } 26 | } ] 27 | } 28 | } 29 | } 30 | } 31 | } 32 | } 33 | } 34 | } 35 | }; -------------------------------------------------------------------------------- /fiddles/po/demo.response.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Alice Smith 4 | 123 Maple Street 5 | Mill Valley 6 | CA 7 | 90952 8 | 9 | 10 | Robert Smith 11 | 8 Oak Avenue 12 | Old Town 13 | PA 14 | 95819 15 | 16 | Hurry, my lawn is going wild! 17 | 18 | 19 | Lawnmower 20 | 1 21 | 148.95 22 | Confirm this is electric 23 | 24 | 25 | Baby Monitor 26 | 1 27 | 39.98 28 | 1999-05-21 29 | 30 | 31 | -------------------------------------------------------------------------------- /fiddles/yq8x0oqf/GetRecords.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | full 7 | 8 | 9 | 10 | 11 | ows:BoundingBox 12 | 13 | -80.0 150.0 14 | 80.0 -150.0 15 | 16 | 17 | 19 | dc:title 20 | %WATER DEPTH% 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /formats/gml-geojson/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /formats/gml-geojson/src/main/javascript/org/hisrc/jsonix/gml/v_3_1_1/GeoJSON.js: -------------------------------------------------------------------------------- 1 | GML_V_3_1_1.GeoJSON = {}; 2 | 3 | -------------------------------------------------------------------------------- /formats/gml-geojson/src/main/javascript/org/hisrc/jsonix/gml/v_3_1_1/GeoJSON/AbstractForwardGeometryConverter.js: -------------------------------------------------------------------------------- 1 | GML_V_3_1_1.GeoJSON.AbstractForwardGeometryConverter = Jsonix.Class({ 2 | initialize : function() { 3 | }, 4 | createGeometry:function(geometry) { 5 | Jsonix.Util.Ensure.ensureObject(geometry); 6 | var result = this.doCreateGeometry(geometry); 7 | // getSridConverter().convert(locator, geometryType, geometry); 8 | return result; 9 | }, 10 | doCreateGeometry: function(geometry) 11 | { 12 | throw 'Abstract method.'; 13 | }, 14 | createGeometryFromProperty: function(property) 15 | { 16 | throw 'Abstract method.'; 17 | }, 18 | createGeometryFromElement: function(geometryElement) { 19 | Jsonix.Util.Ensure.ensureObject(geometryElement); 20 | Jsonix.Util.Ensure.ensureObject(geometryElement.name); 21 | Jsonix.Util.Ensure.ensureObject(geometryElement.value); 22 | return this.createGeometry(geometryElement.value); 23 | }, 24 | CLASS_NAME : "GML_V_3_1_1.GeoJSON.AbstractForwardGeometryConverter" 25 | }); -------------------------------------------------------------------------------- /formats/gml-geojson/src/main/javascript/org/hisrc/jsonix/gml/v_3_1_1/GeoJSON/AbstractInverseGeometryConverter.js: -------------------------------------------------------------------------------- 1 | GML_V_3_1_1.GeoJSON.AbstractInverseGeometryConverter = Jsonix.Class({ 2 | initialize : function() { 3 | }, 4 | createGeometryType:function(geometry) 5 | { 6 | var target = this.doCreateGeometryType(geometry); 7 | //getSrsReferenceGroupConverter().convert(geometry, target); 8 | return target; 9 | }, 10 | doCreateGeometryType: function(geometry) 11 | { 12 | throw 'Abstract method'; 13 | }, 14 | createPropertyType: function(geometry) 15 | { 16 | throw 'Abstract method'; 17 | }, 18 | createElement: function(geometry) 19 | { 20 | throw 'Abstract method'; 21 | }, 22 | CLASS_NAME : "GML_V_3_1_1.GeoJSON.AbstractInverseGeometryConverter" 23 | }); -------------------------------------------------------------------------------- /formats/gml-geojson/src/main/javascript/org/hisrc/jsonix/gml/v_3_1_1/GeoJSON/ForwardLinearRingConverter.js: -------------------------------------------------------------------------------- 1 | GML_V_3_1_1.GeoJSON.ForwardLinearRingConverter = Jsonix.Class(GML_V_3_1_1.GeoJSON.ForwardLineStringConverter, { 2 | initialize : function(options) { 3 | Jsonix.Util.Ensure.ensureObject(options); 4 | GML_V_3_1_1.GeoJSON.ForwardLineStringConverter.prototype.initialize.apply(this, [ options ]); 5 | }, 6 | createGeometryFromProperty: function(linearRingProperty) { 7 | if (Jsonix.Util.Type.exists(linearRingProperty.linearRing)) { 8 | return { type: 'LineString', coordinates : this.createGeometry(linearRingProperty.linearRing).coordinates }; 9 | } else { 10 | throw "Expected [LinearRing] element."; 11 | } 12 | }, 13 | CLASS_NAME : "GML_V_3_1_1.GeoJSON.ForwardLinearRingConverter" 14 | }); -------------------------------------------------------------------------------- /formats/gml-geojson/src/main/javascript/org/hisrc/jsonix/gml/v_3_1_1/GeoJSON/ForwardMultiPolygonConverter.js: -------------------------------------------------------------------------------- 1 | GML_V_3_1_1.GeoJSON.ForwardMultiPolygonConverter = Jsonix.Class(GML_V_3_1_1.GeoJSON.AbstractForwardGeometryConverter, { 2 | polygonConverter: null, 3 | initialize : function(options) { 4 | Jsonix.Util.Ensure.ensureObject(options); 5 | GML_V_3_1_1.GeoJSON.AbstractForwardGeometryConverter.prototype.initialize.apply(this, [ options ]); 6 | Jsonix.Util.Ensure.ensureObject(options.polygonConverter); 7 | this.polygonConverter = options.polygonConverter; 8 | }, 9 | doCreateGeometry: function(multiPolygon) { 10 | var coordinates = []; 11 | if (Jsonix.Util.Type.exists(multiPolygon.polygonMember)) { 12 | Jsonix.Util.Ensure.ensureArray(multiPolygon.polygonMember); 13 | for (var index0 = 0; index0 < multiPolygon.polygonMember.length; index0++) 14 | { 15 | coordinates.push(this.polygonConverter.createGeometryFromProperty(multiPolygon.polygonMember[index0]).coordinates); 16 | } 17 | } 18 | return { type : 'MultiPolygon', coordinates : coordinates}; 19 | }, 20 | createGeometryFromProperty: function(multiPolygonProperty) { 21 | if (Jsonix.Util.Type.exists(multiPolygonProperty.multiPolygon)) { 22 | return this.createGeometry(multiPolygonProperty.multiPolygon); 23 | } else { 24 | throw "Expected [MultiPolygon] element."; 25 | } 26 | }, 27 | CLASS_NAME : "GML_V_3_1_1.GeoJSON.ForwardMultiPolygonConverter" 28 | }); -------------------------------------------------------------------------------- /formats/gml-geojson/src/main/javascript/org/hisrc/jsonix/gml/v_3_1_1/GeoJSON/GeometryAdapter.js: -------------------------------------------------------------------------------- 1 | GML_V_3_1_1.GeoJSON.GeometryAdapter = Jsonix.Class({ 2 | forwardGeometryConverter: null, 3 | inverseGeometryConverter: null, 4 | initialize : function(options) { 5 | this.forwardGeometryConverter = new GML_V_3_1_1.GeoJSON.ForwardGeometryConverter(); 6 | this.inverseGeometryConverter = new GML_V_3_1_1.GeoJSON.InverseGeometryConverter(); 7 | }, 8 | unmarshal: function(context, input, typeInfo) 9 | { 10 | var name = Jsonix.XML.QName.fromObject(input.getName()); 11 | var value = typeInfo.unmarshal(context, input); 12 | var geometryElement = { 13 | name : name, 14 | value : value 15 | }; 16 | var geometry = this.forwardGeometryConverter.createGeometryFromElement(geometryElement); 17 | return geometry; 18 | }, 19 | marshal: function(context, geometry, output, typeInfo) 20 | { 21 | var geometryElement = this.inverseGeometryConverter.createElement(geometry); 22 | typeInfo.marshal(context, geometryElement.value, output); 23 | }, 24 | CLASS_NAME : "GML_V_3_1_1.GeoJSON.GeometryAdapter" 25 | }); 26 | GML_V_3_1_1.GeoJSON.GeometryAdapter.INSTANCE = new GML_V_3_1_1.GeoJSON.GeometryAdapter(); -------------------------------------------------------------------------------- /formats/gml-geojson/src/main/javascript/org/hisrc/jsonix/gml/v_3_1_1/GeoJSON/InverseLineStringConverter.js: -------------------------------------------------------------------------------- 1 | GML_V_3_1_1.GeoJSON.InverseLineStringConverter = Jsonix.Class(GML_V_3_1_1.GeoJSON.AbstractInverseGeometryConverter, { 2 | coordinateConverter: null, 3 | initialize : function(options) { 4 | Jsonix.Util.Ensure.ensureObject(options); 5 | GML_V_3_1_1.GeoJSON.AbstractInverseGeometryConverter.prototype.initialize.apply(this, [ options ]); 6 | Jsonix.Util.Ensure.ensureObject(options.coordinateConverter); 7 | this.coordinateConverter = options.coordinateConverter; 8 | }, 9 | doCreateGeometryType: function(lineString) { 10 | Jsonix.Util.Ensure.ensureObject(lineString); 11 | Jsonix.Util.Ensure.ensureArray(lineString.coordinates); 12 | var resultLineString = { 13 | posList: this.coordinateConverter.convertCoordinates(lineString.coordinates) 14 | }; 15 | return resultLineString; 16 | }, 17 | createPropertyType: function(lineString) { 18 | var lineStringPropertyType = {}; 19 | lineStringPropertyType.lineString = this.createGeometryType(lineString); 20 | return lineStringPropertyType; 21 | }, 22 | createElement: function(lineString) { 23 | return { 24 | name : new Jsonix.XML.QName("http://www.opengis.net/gml", "LineString"), 25 | value : this.createGeometryType(lineString) 26 | }; 27 | }, 28 | CLASS_NAME : "GML_V_3_1_1.GeoJSON.InverseLineStringConverter" 29 | }); -------------------------------------------------------------------------------- /formats/gml-geojson/src/main/javascript/org/hisrc/jsonix/gml/v_3_1_1/GeoJSON/InverseLinearRingConverter.js: -------------------------------------------------------------------------------- 1 | GML_V_3_1_1.GeoJSON.InverseLinearRingConverter = Jsonix.Class(GML_V_3_1_1.GeoJSON.InverseLineStringConverter, { 2 | initialize : function(options) { 3 | Jsonix.Util.Ensure.ensureObject(options); 4 | GML_V_3_1_1.GeoJSON.InverseLineStringConverter.prototype.initialize.apply(this, [ options ]); 5 | }, 6 | createElement: function(linearRing) { 7 | return { 8 | name : new Jsonix.XML.QName("http://www.opengis.net/gml", "LinearRing"), 9 | value : this.createGeometryType(linearRing) 10 | }; 11 | }, 12 | CLASS_NAME : "GML_V_3_1_1.GeoJSON.InverseLinearRingConverter" 13 | }); -------------------------------------------------------------------------------- /formats/gml-geojson/src/main/javascript/org/hisrc/jsonix/gml/v_3_1_1/GeoJSON/InversePointConverter.js: -------------------------------------------------------------------------------- 1 | GML_V_3_1_1.GeoJSON.InversePointConverter = Jsonix.Class(GML_V_3_1_1.GeoJSON.AbstractInverseGeometryConverter, { 2 | coordinateConverter: null, 3 | initialize : function(options) { 4 | Jsonix.Util.Ensure.ensureObject(options); 5 | GML_V_3_1_1.GeoJSON.AbstractInverseGeometryConverter.prototype.initialize.apply(this, [ options ]); 6 | Jsonix.Util.Ensure.ensureObject(options.coordinateConverter); 7 | this.coordinateConverter = options.coordinateConverter; 8 | }, 9 | doCreateGeometryType: function(point) { 10 | Jsonix.Util.Ensure.ensureObject(point); 11 | Jsonix.Util.Ensure.ensureArray(point.coordinates); 12 | var resultPoint = {}; 13 | var directPosition = this.coordinateConverter 14 | .convertCoordinate(point.coordinates); 15 | resultPoint.pos = directPosition; 16 | return resultPoint; 17 | }, 18 | createPropertyType: function(point) { 19 | var pointPropertyType = {}; 20 | pointPropertyType.point = this.createGeometryType(point); 21 | return pointPropertyType; 22 | }, 23 | createElement: function(point) { 24 | return { 25 | name : new Jsonix.XML.QName("http://www.opengis.net/gml", "Point"), 26 | value : this.createGeometryType(point) 27 | }; 28 | }, 29 | CLASS_NAME : "GML_V_3_1_1.GeoJSON.InversePointConverter" 30 | }); -------------------------------------------------------------------------------- /formats/gml-geojson/src/main/resources/xlink/1.0.0/ReadMe.txt: -------------------------------------------------------------------------------- 1 | This XML Schema Document named xlinks.xsd has been stored here based 2 | on the change request: 3 | OGC 05-068r1 "Store xlinks.xsd file at a fixed location" 4 | 5 | Arliss Whiteside, 2005-11-22 6 | 7 | -------------------------------------------------------------------------------- /formats/gml-geojson/src/test/javascript/org/hisrc/jsonix/gml/v_3_1_1/geojson/tests/GML311GeoJSONTest.scripts: -------------------------------------------------------------------------------- 1 | /org/hisrc/jsonix/SingleFile.scripts 2 | /org/hisrc/jsonix/Jsonix.complete.scripts 3 | GML311GeoJSONTest.test.scripts -------------------------------------------------------------------------------- /formats/gml-geojson/src/test/javascript/org/hisrc/jsonix/gml/v_3_1_1/geojson/tests/GML311GeoJSONTest.test.scripts: -------------------------------------------------------------------------------- 1 | /net/opengis/gml/v_3_1_1/profiles/gmlsfprofile/v_1_0_0/Mappings.js 2 | /org/hisrc/jsonix/gml/v_3_1_1/GeoJSON.scripts 3 | GML311GeoJSONTest.js -------------------------------------------------------------------------------- /formats/gml-geojson/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootCategory=DEBUG, stdout 2 | 3 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 4 | log4j.appender.stdout.target=system.out 5 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.stdout.layout.ConversionPattern=%d %p [%c{3}] | <%m>%n 7 | 8 | log4j.logger.com.gargoylesoftware.htmlunit=WARN -------------------------------------------------------------------------------- /formats/gml-geojson/src/test/resources/org/hisrc/jsonix/gml/v_3_1_1/geojson/tests/LineString0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0 0 5 | 1 0 6 | 1 1 7 | 0 1 8 | 9 | -------------------------------------------------------------------------------- /formats/gml-geojson/src/test/resources/org/hisrc/jsonix/gml/v_3_1_1/geojson/tests/LineString1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0 0 4 | 1 0 5 | 1 1 6 | 0 1 7 | -------------------------------------------------------------------------------- /formats/gml-geojson/src/test/resources/org/hisrc/jsonix/gml/v_3_1_1/geojson/tests/LineString2.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 0,0 1,0 1,1 0,1 6 | -------------------------------------------------------------------------------- /formats/gml-geojson/src/test/resources/org/hisrc/jsonix/gml/v_3_1_1/geojson/tests/LineString3.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 0 0 6 | 7 | 8 | 1 0 9 | 10 | 11 | 12 | 13 | 1 1 14 | 15 | 16 | 17 | 0 18 | 1 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /formats/gml-geojson/src/test/resources/org/hisrc/jsonix/gml/v_3_1_1/geojson/tests/LinearRing0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0 0 4 | 1 0 5 | 1 1 6 | 0 1 7 | 0 0 8 | -------------------------------------------------------------------------------- /formats/gml-geojson/src/test/resources/org/hisrc/jsonix/gml/v_3_1_1/geojson/tests/LinearRing1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0 0 5 | 1 0 6 | 1 1 7 | 0 1 8 | 0 0 9 | 10 | -------------------------------------------------------------------------------- /formats/gml-geojson/src/test/resources/org/hisrc/jsonix/gml/v_3_1_1/geojson/tests/MultiGeometry0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 0 0 6 | 7 | 8 | 9 | 10 | 1 0 11 | 12 | 13 | 14 | 15 | 1 1 16 | 17 | 18 | 0 1 19 | 20 | 21 | -------------------------------------------------------------------------------- /formats/gml-geojson/src/test/resources/org/hisrc/jsonix/gml/v_3_1_1/geojson/tests/MultiGeometry1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 100 0 6 | 7 | 8 | 9 | 10 | 100.0 0.0 101.0 1.0 11 | 12 | 13 | 14 | 15 | 16 | 17 | 100.0 0.0 101.0 0.0 101.0 1.0 100.0 1.0 100.0 0.0 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 100.0 0.0 101.0 0.0 101.0 1.0 100.0 1.0 100.0 0.0 27 | 28 | 29 | 30 | 31 | 100.2 0.2 100.8 0.2 100.8 0.8 100.2 0.8 100.2 0.2 32 | 33 | 34 | 35 | 36 | 44 | -------------------------------------------------------------------------------- /formats/gml-geojson/src/test/resources/org/hisrc/jsonix/gml/v_3_1_1/geojson/tests/MultiLineString0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 0 0 7 | 1 0 8 | 1 1 9 | 0 1 10 | 11 | 12 | 13 | 14 | 15 | 16 | 2 2 17 | 3 2 18 | 3 3 19 | 2 3 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /formats/gml-geojson/src/test/resources/org/hisrc/jsonix/gml/v_3_1_1/geojson/tests/MultiPoint0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 0 0 6 | 7 | 8 | 9 | 10 | 1 0 11 | 12 | 13 | -------------------------------------------------------------------------------- /formats/gml-geojson/src/test/resources/org/hisrc/jsonix/gml/v_3_1_1/geojson/tests/MultiPoint1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 0 0 6 | 7 | 8 | 9 | 10 | 1 0 11 | 12 | 13 | 14 | 15 | 1 1 16 | 17 | 18 | 0 1 19 | 20 | 21 | -------------------------------------------------------------------------------- /formats/gml-geojson/src/test/resources/org/hisrc/jsonix/gml/v_3_1_1/geojson/tests/MultiPolygon0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 0 0 8 | 1 0 9 | 1 1 10 | 0 1 11 | 0 0 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /formats/gml-geojson/src/test/resources/org/hisrc/jsonix/gml/v_3_1_1/geojson/tests/Point0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0 1 4 | -------------------------------------------------------------------------------- /formats/gml-geojson/src/test/resources/org/hisrc/jsonix/gml/v_3_1_1/geojson/tests/Point1.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 0,1 5 | -------------------------------------------------------------------------------- /formats/gml-geojson/src/test/resources/org/hisrc/jsonix/gml/v_3_1_1/geojson/tests/Point2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0 5 | 1 6 | 7 | -------------------------------------------------------------------------------- /formats/gml-geojson/src/test/resources/org/hisrc/jsonix/gml/v_3_1_1/geojson/tests/Point3.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 0 1 7 | -------------------------------------------------------------------------------- /formats/gml-geojson/src/test/resources/org/hisrc/jsonix/gml/v_3_1_1/geojson/tests/Point4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0 1 4 | -------------------------------------------------------------------------------- /formats/gml-geojson/src/test/resources/org/hisrc/jsonix/gml/v_3_1_1/geojson/tests/Point5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0 1 4 | -------------------------------------------------------------------------------- /formats/gml-geojson/src/test/resources/org/hisrc/jsonix/gml/v_3_1_1/geojson/tests/Polygon0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 0 0 6 | 1 0 7 | 1 1 8 | 0 1 9 | 0 0 10 | 11 | 12 | -------------------------------------------------------------------------------- /formats/gml-geojson/src/test/resources/org/hisrc/jsonix/gml/v_3_1_1/geojson/tests/Polygon1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 0 0 7 | 1 0 8 | 1 1 9 | 0 1 10 | 0 0 11 | 12 | 13 | 14 | 15 | 16 | 17 | 0.1 0.1 18 | 0.9 0.1 19 | 0.9 0.9 20 | 0.1 0.9 21 | 0.1 0.1 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /formats/gml-geojson/src/test/resources/org/hisrc/jsonix/gml/v_3_1_1/geojson/tests/Polygon2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 0 0 6 | 100 0 7 | 100 100 8 | 0 100 9 | 0 0 10 | 11 | 12 | 13 | 14 | 10 10 15 | 90 10 16 | 90 90 17 | 10 90 18 | 10 10 19 | 20 | 21 | -------------------------------------------------------------------------------- /formats/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | jsonix-formats 4 | pom 5 | Jsonix Formats 6 | 7 | org.hisrc.jsonix 8 | jsonix-project 9 | 2.0.0-SNAPSHOT 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /formats/src/main/resources/.placeholder: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highsource/jsonix/5d0d101f338bcf514bb6249437860e4b4d011cd2/formats/src/main/resources/.placeholder -------------------------------------------------------------------------------- /full-build-1.8.bat: -------------------------------------------------------------------------------- 1 | setlocal 2 | echo Setting JAVA_HOME to %JAVA8_HOME%. 3 | set JAVA_HOME=%JAVA8_HOME% 4 | call mvn clean install -Pall,sonatype-oss-release -DperformRelease 5 | endlocal -------------------------------------------------------------------------------- /images/logo_WebStorm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highsource/jsonix/5d0d101f338bcf514bb6249437860e4b4d011cd2/images/logo_WebStorm.png -------------------------------------------------------------------------------- /install.bat: -------------------------------------------------------------------------------- 1 | setlocal 2 | echo Setting JAVA_HOME to %JAVA8_HOME%. 3 | set JAVA_HOME=%JAVA8_HOME% 4 | echo Performing a short clean build. 5 | call mvn clean install -DperformRelease 6 | echo Short clean build completed. 7 | echo Performing a full clean build. 8 | call mvn clean install -DperformRelease -Ptests,demos,samples 9 | echo Full clean build completed. 10 | pause 11 | endlocal -------------------------------------------------------------------------------- /nodejs/demos/fossgis2015/wms-01/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | -------------------------------------------------------------------------------- /nodejs/demos/fossgis2015/wms-01/bindings/wms-v_1_3_0.jsonix.xjb: -------------------------------------------------------------------------------- 1 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /nodejs/demos/fossgis2015/wms-01/bindings/wms-v_1_3_0.xjb: -------------------------------------------------------------------------------- 1 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /nodejs/demos/fossgis2015/wms-01/bindings/xlink-v_1_0.xjb: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /nodejs/demos/fossgis2015/wms-01/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jsonix-demos-fossgis2015-wms-01", 3 | "description": "Jsonix Demos FOSSGIS2015 WMS 01", 4 | "version": "1.0.0", 5 | "engines": [ 6 | "node >= 0.8.0" 7 | ], 8 | "main": "jsonix-demos-wms.js", 9 | "dependencies": { 10 | "jsonix": "2.x.x", 11 | "jsonix-schema-compiler": "2.x.x" 12 | }, 13 | "devDependencies" : { 14 | "nodeunit" : "~0.8.6", 15 | "node-static" : "~0.7.3" 16 | }, 17 | "scripts": { 18 | "prepublish" : "java -jar node_modules/jsonix-schema-compiler/lib/jsonix-schema-compiler-full.jar -compact -d mappings -catalog schemas/catalog.cat schemas/ogc/wms/1.3.0/capabilities_1_3_0.xsd -b bindings", 19 | "test": "nodeunit tests/tests.js" 20 | } 21 | } -------------------------------------------------------------------------------- /nodejs/demos/fossgis2015/wms-01/schemas/catalog.cat: -------------------------------------------------------------------------------- 1 | REWRITE_SYSTEM "http://schemas.opengis.net" "ogc" 2 | REWRITE_SYSTEM "http://www.w3.org" "w3c" 3 | -------------------------------------------------------------------------------- /nodejs/demos/fossgis2015/wms-01/schemas/ogc/wms/1.3.0/exceptions_1_3_0.xsd: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /nodejs/demos/user/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | -------------------------------------------------------------------------------- /nodejs/demos/user/jsonix-demo-user.js: -------------------------------------------------------------------------------- 1 | var Mapping = { 2 | name : 'Mapping', 3 | typeInfos : [ { 4 | localName : 'Data', 5 | propertyInfos : [ { 6 | name : 'user' 7 | }, { 8 | name : 'uri' 9 | }, { 10 | name : 'items', 11 | collection : true, 12 | typeInfo : '.Item' 13 | }, { 14 | name : 'info' 15 | } ] 16 | }, { 17 | localName : 'Item', 18 | propertyInfos : [ { 19 | name : 'uri' 20 | } ] 21 | } ], 22 | elementInfos : [ { 23 | elementName : { 24 | localPart : 'data' 25 | }, 26 | typeInfo : '.Data' 27 | } ] 28 | }; 29 | module.exports.Mapping = Mapping; 30 | -------------------------------------------------------------------------------- /nodejs/demos/user/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jsonix-demos-user", 3 | "description": "Jsonix Demos User.", 4 | "version": "2.1.0", 5 | "engines": [ 6 | "node >= 0.8.0" 7 | ], 8 | "main": "jsonix-demo-user.js", 9 | "dependencies": { 10 | "jsonix": "~2.1.0" 11 | }, 12 | "devDependencies" : { 13 | "nodeunit" : "~0.8.6", 14 | "node-static" : "~0.7.3" 15 | }, 16 | "scripts": { 17 | "test": "nodeunit tests/tests.js" 18 | } 19 | } -------------------------------------------------------------------------------- /nodejs/demos/user/tests/sample01.xml: -------------------------------------------------------------------------------- 1 | 2 | 505723c5750c1fa2177682ed 3 | http://localhost:3000/users/505723c5750c1fa2177682ed/items 4 | 5 | http://localhost:3000/items/1 6 | 7 | 8 | http://localhost:3000/items/2 9 | 10 | blah. 11 | -------------------------------------------------------------------------------- /nodejs/demos/user/tests/tests.js: -------------------------------------------------------------------------------- 1 | process.on('uncaughtException', function(err) { 2 | console.error(err.stack); 3 | }); 4 | module.exports = { 5 | "user-tests" : require('./user-tests') 6 | }; 7 | -------------------------------------------------------------------------------- /nodejs/demos/user/tests/user-tests.js: -------------------------------------------------------------------------------- 1 | var Jsonix = require('jsonix').Jsonix; 2 | var Mapping = require('../jsonix-demo-user').Mapping; 3 | 4 | module.exports = { 5 | "Marshal" : function(test) { 6 | 7 | // Create Jsonix context 8 | var context = new Jsonix.Context([ Mapping ]); 9 | 10 | var data = { 11 | name : new Jsonix.XML.QName('data'), 12 | value : { 13 | "user" : "505723c5750c1fa2177682ed", 14 | "uri" : "http://localhost:3000/users/505723c5750c1fa2177682ed/items", 15 | "items" : [ { 16 | "uri" : "http://localhost:3000/items/1" 17 | }, { 18 | "uri" : "http://localhost:3000/items/2" 19 | } ], 20 | "info" : "blah." 21 | } 22 | }; 23 | 24 | var marshaller = context.createMarshaller(); 25 | 26 | console.log(marshaller.marshalString(data)); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /nodejs/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | jsonix-nodejs 4 | pom 5 | Jsonix Node.js 6 | 7 | org.hisrc.jsonix 8 | jsonix-project 9 | 3.0.1-SNAPSHOT 10 | 11 | 12 | scripts 13 | tests 14 | 15 | -------------------------------------------------------------------------------- /nodejs/scripts/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /jsonix.js 3 | /.idea/ 4 | lib 5 | target 6 | 1 7 | 2 8 | *.tgz 9 | -------------------------------------------------------------------------------- /nodejs/scripts/.npmignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | node_modules 3 | *.tgz -------------------------------------------------------------------------------- /nodejs/scripts/lib/.gitignore: -------------------------------------------------------------------------------- 1 | *.jar -------------------------------------------------------------------------------- /nodejs/scripts/lib/.npmignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highsource/jsonix/5d0d101f338bcf514bb6249437860e4b4d011cd2/nodejs/scripts/lib/.npmignore -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH111/GH111.js: -------------------------------------------------------------------------------- 1 | var Jsonix = require("../../jsonix").Jsonix; 2 | var GH111 = require("./Mappings.js").GH111; 3 | 4 | module.exports = { 5 | "MarshallsWithPrefix" : function(test) { 6 | var context = new Jsonix.Context([GH111], { 7 | namespacePrefixes : { 8 | "urn:test" : "" 9 | } 10 | }); 11 | var rootType = context.getTypeInfoByName("GH111.Root"); 12 | test.equal('urn:gh111', rootType.getPropertyInfoByName("value").elementTypeInfos[0].elementName.namespaceURI); 13 | test.done(); 14 | } 15 | }; 16 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH111/Mappings.js: -------------------------------------------------------------------------------- 1 | var GH111 = { 2 | name: "GH111", 3 | dens: "urn:gh111", 4 | typeInfos: [{ 5 | localName: "Root", 6 | propertyInfos: [{ 7 | name: "value", 8 | type: "elements", 9 | collection: true, 10 | elementTypeInfos: [{ 11 | elementName: "a", 12 | typeInfo: "String" 13 | }, { 14 | elementName: "b", 15 | typeInfo: "Integer" 16 | }] 17 | }] 18 | }], 19 | elementInfos: [{ 20 | elementName: "root", 21 | typeInfo: ".Root" 22 | }] 23 | 24 | }; 25 | module.exports.GH111 = GH111; -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH135/A.js: -------------------------------------------------------------------------------- 1 | var A = { 2 | name: 'A', 3 | typeInfos: [ 4 | { 5 | localName: 'BaseType', 6 | propertyInfos: [{name: 'value', typeInfo: '.ValueType'}] 7 | }, { 8 | localName: 'ValueType', 9 | propertyInfos: [{name: 'data'}] 10 | } 11 | ] 12 | }; 13 | module.exports.A = A; -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH135/B.js: -------------------------------------------------------------------------------- 1 | var B = { 2 | name: 'B', 3 | dependencies: ['A'], 4 | typeInfos: [ 5 | { 6 | localName: 'ExtendedType', 7 | baseTypeInfo: 'A.BaseType' 8 | } 9 | ] 10 | }; 11 | module.exports.B = B; -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH135/GH135.js: -------------------------------------------------------------------------------- 1 | var Jsonix = require("../../jsonix").Jsonix; 2 | var A = require("./A.js").A; 3 | var B = require("./B.js").B; 4 | 5 | module.exports = { 6 | "A_B" : function(test) { 7 | var context = new Jsonix.Context([A, B]); 8 | context.createMarshaller(); 9 | context.createUnmarshaller(); 10 | test.done(); 11 | }, 12 | "B_A" : function(test) { 13 | var context = new Jsonix.Context([B, A]); 14 | context.createMarshaller(); 15 | context.createUnmarshaller(); 16 | test.done(); 17 | } 18 | }; 19 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH150/A.js: -------------------------------------------------------------------------------- 1 | var A = { 2 | name: 'A', 3 | typeInfos: [ 4 | { 5 | localName: 'BaseType', 6 | propertyInfos: [{name: 'value', typeInfo: '.ValueType', type: 'er' }] 7 | }, { 8 | localName: 'ValueType', 9 | propertyInfos: [{name: 'data'}] 10 | } 11 | ], 12 | elementInfos: [{elementName: 'value', typeInfo: '.ValueType'}] 13 | }; 14 | module.exports.A = A; -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH150/B.js: -------------------------------------------------------------------------------- 1 | var B = { 2 | name: 'B', 3 | dependencies: ['A'], 4 | elementInfos: [{elementName: 'eulav', typeInfo: 'A.ValueType', sh: {lp:'value', ns: ''}}] 5 | }; 6 | module.exports.B = B; -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH150/GH150.js: -------------------------------------------------------------------------------- 1 | var Jsonix = require("../../jsonix").Jsonix; 2 | var A = require("./A.js").A; 3 | var B = require("./B.js").B; 4 | 5 | module.exports = { 6 | "A_B" : function(test) { 7 | var context = new Jsonix.Context([A, B]); 8 | var baseType = context.getTypeInfoByName('A.BaseType'); 9 | test.ok(baseType.structure.elements.value); 10 | test.ok(baseType.structure.elements.eulav); 11 | test.done(); 12 | }, 13 | "B_A" : function(test) { 14 | var context = new Jsonix.Context([B, A]); 15 | var baseType = context.getTypeInfoByName('A.BaseType'); 16 | test.ok(baseType.structure.elements.value); 17 | test.ok(baseType.structure.elements.eulav); 18 | test.done(); 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/anyAttribute-0.simplified.json: -------------------------------------------------------------------------------- 1 | { 2 | "anyAttribute" : { 3 | "value" : "test", 4 | "otherAttributes" : { 5 | "a" : "a", 6 | "b" : "b" 7 | }, 8 | "TYPE_NAME" : "Zero.AnyAttributeType" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/anyAttribute-0.standard.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : { "localPart" : "anyAttribute", "namespaceURI" : "", "prefix" : "", "key" : "anyAttribute", "string" : "anyAttribute" }, 3 | "value" : { 4 | "value" : "test", 5 | "otherAttributes" : { 6 | "a" : "a", 7 | "b" : "b" 8 | }, 9 | "TYPE_NAME" : "Zero.AnyAttributeType" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/anyAttribute-0.xml: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/anyElementLax-0.simplified.json: -------------------------------------------------------------------------------- 1 | { 2 | "anyElementLax" : { 3 | "any" : { 4 | "string" : "test" 5 | }, 6 | "TYPE_NAME" : "Zero.AnyElementLaxType" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/anyElementLax-0.standard.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : { "localPart" : "anyElementLax", "namespaceURI" : "", "prefix" : "", "key" : "anyElementLax", "string" : "anyElementLax" }, 3 | "value" : { 4 | "any" : { 5 | "name" : { "localPart" : "string", "namespaceURI" : "", "prefix" : "", "key" : "string", "string" : "string" }, 6 | "value" : "test" 7 | }, 8 | "TYPE_NAME" : "Zero.AnyElementLaxType" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/anyElementLax-0.xml: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/attribute-0.simplified.json: -------------------------------------------------------------------------------- 1 | { 2 | "attribute" : { 3 | "value" : "test", 4 | "string" : "zero", 5 | "integers" : [ 1, 2 ], 6 | "TYPE_NAME" : "Zero.AttributeType" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/attribute-0.standard.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : { "localPart" : "attribute", "namespaceURI" : "", "prefix" : "", "key" : "attribute", "string" : "attribute" }, 3 | "value" : { 4 | "value" : "test", 5 | "string" : "zero", 6 | "integers" : [ 1, 2 ], 7 | "TYPE_NAME" : "Zero.AttributeType" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/attribute-0.xml: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/base-0.simplified.json: -------------------------------------------------------------------------------- 1 | { 2 | "base" : { 3 | "alpha" : "one", 4 | "beta" : [ 2 ], 5 | "TYPE_NAME" : "Zero.BaseType" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/base-0.standard.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : { "localPart" : "base", "namespaceURI" : "", "prefix" : "", "key" : "base", "string" : "base" }, 3 | "value" : { 4 | "alpha" : "one", 5 | "beta" : [ 2 ], 6 | "TYPE_NAME" : "Zero.BaseType" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/base-0.xml: -------------------------------------------------------------------------------- 1 | one2 -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/element-0.simplified.json: -------------------------------------------------------------------------------- 1 | { 2 | "element" : { 3 | "element" : "one", 4 | "elements" : [ "two", "three" ], 5 | "item" : [ "four", "five" ], 6 | "items" : [ { 7 | "items" : [ "six", "seven" ] 8 | }, { 9 | "items" : [ "eight", "nine" ] 10 | } ], 11 | "TYPE_NAME" : "Zero.ElementType" 12 | } 13 | } -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/element-0.standard.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : { "localPart" : "element", "namespaceURI" : "", "prefix" : "", "key" : "element", "string" : "element" }, 3 | "value" : { 4 | "element" : "one", 5 | "elements" : [ "two", "three" ], 6 | "item" : [ "four", "five" ], 7 | "items" : [ { 8 | "name" : { "localPart" : "items", "namespaceURI" : "", "prefix" : "", "key" : "items", "string" : "items" }, 9 | "value" : [ "six", "seven" ] 10 | }, { 11 | "name" : { "localPart" : "items", "namespaceURI" : "", "prefix" : "", "key" : "items", "string" : "items" }, 12 | "value" : [ "eight", "nine" ] 13 | } ], 14 | "TYPE_NAME" : "Zero.ElementType" 15 | } 16 | } -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/element-0.xml: -------------------------------------------------------------------------------- 1 | onetwothreefour fivesix seveneight nine -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/element-1.simplified.json: -------------------------------------------------------------------------------- 1 | { 2 | "element" : { 3 | "element" : "one", 4 | "TYPE_NAME" : "Zero.ElementType" 5 | } 6 | } -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/element-1.standard.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : { "localPart" : "element", "namespaceURI" : "", "prefix" : "", "key" : "element", "string" : "element" }, 3 | "value" : { 4 | "element" : "one", 5 | "TYPE_NAME" : "Zero.ElementType" 6 | } 7 | } -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/element-1.xml: -------------------------------------------------------------------------------- 1 | one -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/elementMap-0.simplified.json: -------------------------------------------------------------------------------- 1 | { 2 | "elementMap" : { 3 | "element" : { 4 | "one" : "earth", 5 | "two" : "wind" 6 | }, 7 | "elements" : { 8 | "three" : "fire", 9 | "four" : "wood" 10 | }, 11 | "elementCollection" : { 12 | "one" : [ "1", "I" ], 13 | "two" : [ "2", "II" ] 14 | }, 15 | "elementsCollection" : { 16 | "three" : [ "3", "III" ], 17 | "four" : [ "4", "IV" ] 18 | }, 19 | "TYPE_NAME" : "Zero.ElementMapType" 20 | } 21 | } -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/elementMap-0.standard.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : { "localPart" : "elementMap", "namespaceURI" : "", "prefix" : "", "key" : "elementMap", "string" : "elementMap" }, 3 | "value" : { 4 | "element" : { 5 | "one" : "earth", 6 | "two" : "wind" 7 | }, 8 | "elements" : { 9 | "three" : "fire", 10 | "four" : "wood" 11 | }, 12 | "elementCollection" : { 13 | "one" : [ "1", "I" ], 14 | "two" : [ "2", "II" ] 15 | }, 16 | "elementsCollection" : { 17 | "three" : [ "3", "III" ], 18 | "four" : [ "4", "IV" ] 19 | }, 20 | "TYPE_NAME" : "Zero.ElementMapType" 21 | } 22 | } -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/elementMap-0.xml: -------------------------------------------------------------------------------- 1 | earthwind1I2IIfirewood3III4IV -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/elementMap-1.simplified.json: -------------------------------------------------------------------------------- 1 | { 2 | "elementMap" : { 3 | "element" : { 4 | "one" : "earth", 5 | "two" : "wind" 6 | }, 7 | "TYPE_NAME" : "Zero.ElementMapType" 8 | } 9 | } -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/elementMap-1.standard.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : { "localPart" : "elementMap", "namespaceURI" : "", "prefix" : "", "key" : "elementMap", "string" : "elementMap" }, 3 | "value" : { 4 | "element" : { 5 | "one" : "earth", 6 | "two" : "wind" 7 | }, 8 | "TYPE_NAME" : "Zero.ElementMapType" 9 | } 10 | } -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/elementMap-1.xml: -------------------------------------------------------------------------------- 1 | earthwind -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/elementRef-0.simplified.json: -------------------------------------------------------------------------------- 1 | { 2 | "elementRef" : { 3 | "base" : [ { 4 | "base" : { 5 | "alpha" : "one", 6 | "beta" : [ 2 ], 7 | "TYPE_NAME" : "Zero.BaseType" 8 | } 9 | } ], 10 | "TYPE_NAME" : "Zero.ElementRefType" 11 | } 12 | } -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/elementRef-0.standard.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : { "localPart" : "elementRef", "namespaceURI" : "", "prefix" : "", "key" : "elementRef", "string" : "elementRef" }, 3 | "value" : { 4 | "base" : [ { 5 | "name" : { "localPart" : "base", "namespaceURI" : "", "prefix" : "", "key" : "base", "string" : "base" }, 6 | "value" : { 7 | "alpha" : "one", 8 | "beta" : [ 2 ], 9 | "TYPE_NAME" : "Zero.BaseType" 10 | } 11 | } ], 12 | "TYPE_NAME" : "Zero.ElementRefType" 13 | } 14 | } -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/elementRef-0.xml: -------------------------------------------------------------------------------- 1 | one2 -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/elementRef-1.simplified.json: -------------------------------------------------------------------------------- 1 | { "elementRef" : { 2 | "base" : [ { 3 | "base" : { 4 | "alpha" : "one", 5 | "beta" : [ 2 ], 6 | "TYPE_NAME" : "Zero.BaseType" 7 | } 8 | }, { 9 | "extended" : { 10 | "alpha" : "one", 11 | "beta" : [ 2 ], 12 | "gamma" : "urn:three", 13 | "TYPE_NAME" : "Zero.ExtendedType" 14 | } 15 | } ], 16 | "TYPE_NAME" : "Zero.ElementRefType" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/elementRef-1.standard.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : { "localPart" : "elementRef", "namespaceURI" : "", "prefix" : "", "key" : "elementRef", "string" : "elementRef" }, 3 | "value" : { 4 | "base" : [ { 5 | "name" : { "localPart" : "base", "namespaceURI" : "", "prefix" : "", "key" : "base", "string" : "base" }, 6 | "value" : { 7 | "alpha" : "one", 8 | "beta" : [ 2 ], 9 | "TYPE_NAME" : "Zero.BaseType" 10 | } 11 | }, { 12 | "name" : { "localPart" : "extended", "namespaceURI" : "", "prefix" : "", "key" : "extended", "string" : "extended" }, 13 | "value" : { 14 | "alpha" : "one", 15 | "beta" : [ 2 ], 16 | "gamma" : "urn:three", 17 | "TYPE_NAME" : "Zero.ExtendedType" 18 | } 19 | } ], 20 | "TYPE_NAME" : "Zero.ElementRefType" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/elementRef-1.xml: -------------------------------------------------------------------------------- 1 | one2one2urn:three -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/elementRefMixed-0.simplified.json: -------------------------------------------------------------------------------- 1 | { 2 | "elementRefMixed" : { 3 | "content" : [ { 4 | "value" : "a" 5 | }, "b", { 6 | "value" : "c" 7 | } ], 8 | "TYPE_NAME" : "Zero.ElementRefMixedType" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/elementRefMixed-0.standard.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : { "localPart" : "elementRefMixed", "namespaceURI" : "", "prefix" : "", "key" : "elementRefMixed", "string" : "elementRefMixed" }, 3 | "value" : { 4 | "content" : [ { 5 | "name" : { "localPart" : "value", "namespaceURI" : "", "prefix" : "", "key" : "value", "string" : "value" }, 6 | "value" : "a" 7 | }, "b", { 8 | "name" : { "localPart" : "value", "namespaceURI" : "", "prefix" : "", "key" : "value", "string" : "value" }, 9 | "value" : "c" 10 | } ], 11 | "TYPE_NAME" : "Zero.ElementRefMixedType" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/elementRefMixed-0.xml: -------------------------------------------------------------------------------- 1 | abc -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/elementRefs-0.simplified.json: -------------------------------------------------------------------------------- 1 | { 2 | "elementRefs" : { 3 | "alphaOrBeta" : [ { 4 | "alpha" : { 5 | "value" : "one", 6 | "TYPE_NAME" : "Zero.ValueType" 7 | } 8 | }, { 9 | "beta" : { 10 | "value" : "2", 11 | "TYPE_NAME" : "Zero.ValueType" 12 | } 13 | } ], 14 | "TYPE_NAME" : "Zero.ElementRefsType" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/elementRefs-0.standard.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : { "localPart" : "elementRefs", "namespaceURI" : "", "prefix" : "", "key" : "elementRefs", "string" : "elementRefs" }, 3 | "value" : { 4 | "alphaOrBeta" : [ { 5 | "name" : { "localPart" : "alpha", "namespaceURI" : "", "prefix" : "", "key" : "alpha", "string" : "alpha" }, 6 | "value" : { 7 | "value" : "one", 8 | "TYPE_NAME" : "Zero.ValueType" 9 | } 10 | }, { 11 | "name" : { "localPart" : "beta", "namespaceURI" : "", "prefix" : "", "key" : "beta", "string" : "beta" }, 12 | "value" : { 13 | "value" : "2", 14 | "TYPE_NAME" : "Zero.ValueType" 15 | } 16 | } ], 17 | "TYPE_NAME" : "Zero.ElementRefsType" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/elementRefs-0.xml: -------------------------------------------------------------------------------- 1 | one2 -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/elements-0.simplified.json: -------------------------------------------------------------------------------- 1 | { 2 | "elements" : { 3 | "stringOrInteger" : [ "one", 2, 3, "four" ], 4 | "TYPE_NAME" : "Zero.ElementsType" 5 | } 6 | } -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/elements-0.standard.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : { "localPart" : "elements", "namespaceURI" : "", "prefix" : "", "key" : "elements", "string" : "elements" }, 3 | "value" : { 4 | "stringOrInteger" : [ "one", 2, 3, "four" ], 5 | "TYPE_NAME" : "Zero.ElementsType" 6 | } 7 | } -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/elements-0.xml: -------------------------------------------------------------------------------- 1 | one23four -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/elements-1.simplified.json: -------------------------------------------------------------------------------- 1 | { 2 | "elements" : { 3 | "stringOrInteger" : [ "one", 2 ], 4 | "TYPE_NAME" : "Zero.ElementsType" 5 | } 6 | } -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/elements-1.standard.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : { "localPart" : "elements", "namespaceURI" : "", "prefix" : "", "key" : "elements", "string" : "elements" }, 3 | "value" : { 4 | "stringOrInteger" : [ "one", 2 ], 5 | "TYPE_NAME" : "Zero.ElementsType" 6 | } 7 | } -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/elements-1.xml: -------------------------------------------------------------------------------- 1 | one2 -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/extended-0.simplified.json: -------------------------------------------------------------------------------- 1 | { 2 | "extended" : { 3 | "alpha" : "one", 4 | "beta" : [ 2 ], 5 | "gamma" : "urn:three", 6 | "TYPE_NAME" : "Zero.ExtendedType" 7 | } 8 | } -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/extended-0.standard.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : { "localPart" : "extended", "namespaceURI" : "", "prefix" : "", "key" : "extended", "string" : "extended" }, 3 | "value" : { 4 | "alpha" : "one", 5 | "beta" : [ 2 ], 6 | "gamma" : "urn:three", 7 | "TYPE_NAME" : "Zero.ExtendedType" 8 | } 9 | } -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/extended-0.xml: -------------------------------------------------------------------------------- 1 | one2urn:three -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/extendedExtended-0.simplified.json: -------------------------------------------------------------------------------- 1 | { 2 | "extendedExtended" : { 3 | "alpha" : "one", 4 | "beta" : [ 2 ], 5 | "gamma" : "urn:three", 6 | "epsilon" : 0.7, 7 | "zeta" : [ 8 ], 8 | "TYPE_NAME" : "Zero.ExtendedExtendedType" 9 | } 10 | } -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/extendedExtended-0.standard.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : { "localPart" : "extendedExtended", "namespaceURI" : "", "prefix" : "", "key" : "extendedExtended", "string" : "extendedExtended" }, 3 | "value" : { 4 | "alpha" : "one", 5 | "beta" : [ 2 ], 6 | "gamma" : "urn:three", 7 | "epsilon" : 0.7, 8 | "zeta" : [ 8 ], 9 | "TYPE_NAME" : "Zero.ExtendedExtendedType" 10 | } 11 | } -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/extendedExtended-0.xml: -------------------------------------------------------------------------------- 1 | one2urn:three0.78 -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/ns/anyAttribute-1.simplified.json: -------------------------------------------------------------------------------- 1 | { 2 | "anyAttribute" : { 3 | "value" : "test", 4 | "otherAttributes" : { 5 | "xmlns:a" : "urn:a", 6 | "xmlns:b" : "urn:b", 7 | "a:a" : "a", 8 | "b:b" : "b" 9 | }, 10 | "TYPE_NAME" : "Zero.AnyAttributeType" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/ns/anyAttribute-1.standard.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : { "localPart" : "anyAttribute", "namespaceURI" : "", "prefix" : "", "key" : "anyAttribute", "string" : "anyAttribute" }, 3 | "value" : { 4 | "value" : "test", 5 | "otherAttributes" : { 6 | "{http://www.w3.org/2000/xmlns/}a" : "urn:a", 7 | "{http://www.w3.org/2000/xmlns/}b" : "urn:b", 8 | "{urn:a}a" : "a", 9 | "{urn:b}b" : "b" 10 | }, 11 | "TYPE_NAME" : "Zero.AnyAttributeType" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/ns/anyAttribute-1.xml: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/simpleTypes-0.simplified.json: -------------------------------------------------------------------------------- 1 | { 2 | "simpleTypes" : { 3 | "qName" : { 4 | "namespaceURI" : "urn:a", 5 | "prefix" : "a", 6 | "localPart" : "aq", 7 | "key" : "{urn:a}aq", 8 | "string" : "{urn:a}a:aq" 9 | }, 10 | "TYPE_NAME" : "Zero.SimpleTypesType" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/simpleTypes-0.standard.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : { "localPart" : "simpleTypes", "namespaceURI" : "", "prefix" : "", "key" : "simpleTypes", "string" : "simpleTypes" }, 3 | "value" : { 4 | "qName" : { 5 | "namespaceURI" : "urn:a", 6 | "prefix" : "a", 7 | "localPart" : "aq", 8 | "key" : "{urn:a}aq", 9 | "string" : "{urn:a}a:aq" 10 | }, 11 | "TYPE_NAME" : "Zero.SimpleTypesType" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/simpleTypes-0.xml: -------------------------------------------------------------------------------- 1 | a:aq -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/string-0.simplified.json: -------------------------------------------------------------------------------- 1 | { 2 | "string" : "test" 3 | } 4 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/string-0.standard.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : { "localPart" : "string", "namespaceURI" : "", "prefix" : "", "key" : "string", "string" : "string" }, 3 | "value" : "test" 4 | } 5 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/string-0.xml: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/value-0.simplified.json: -------------------------------------------------------------------------------- 1 | { 2 | "value" : { 3 | "value" : "test", 4 | "attribute" : "check", 5 | "TYPE_NAME" : "Zero.ValueType" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/value-0.standard.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : { "localPart" : "value", "namespaceURI" : "", "prefix" : "", "key" : "value", "string" : "value" }, 3 | "value" : { 4 | "value" : "test", 5 | "attribute" : "check", 6 | "TYPE_NAME" : "Zero.ValueType" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH56/value-0.xml: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH61/GH61.js: -------------------------------------------------------------------------------- 1 | var Jsonix = require("../../jsonix").Jsonix; 2 | var Zero = require("./Mappings.js").Zero; 3 | 4 | module.exports = { 5 | "GetTypeInfoByTypeNameKey" : function(test) { 6 | var context = new Jsonix.Context([Zero], { 7 | namespacePrefixes : { 8 | 'urn:zero' : 'zero', 9 | 'urn:orez' : 'orez', 10 | 'urn:c' : 'c', 11 | } 12 | }); 13 | test.equal("String", context.getTypeInfoByTypeNameKey("{http://www.w3.org/2001/XMLSchema}string").name); 14 | test.equal("Zero.AType", context.getTypeInfoByTypeNameKey("{urn:orez}AType").name); 15 | test.equal("Zero.BType", context.getTypeInfoByTypeNameKey("B").name); 16 | test.equal("Zero.CType", context.getTypeInfoByTypeNameKey("{urn:c}C").name); 17 | test.equal("Zero.DType", context.getTypeInfoByTypeNameKey("{urn:orez}D").name); 18 | test.equal("String", context.getTypeInfoByTypeName({ns:'http://www.w3.org/2001/XMLSchema', lp: 'string'}).name); 19 | test.equal("Zero.AType", context.getTypeInfoByTypeName({ns:'urn:orez', lp: 'AType'}).name); 20 | test.equal("Zero.AType", context.getTypeInfoByTypeName('orez:AType').name); 21 | test.equal("Zero.BType", context.getTypeInfoByTypeName("B").name); 22 | test.equal("Zero.CType", context.getTypeInfoByTypeName('{urn:c}C').name); 23 | test.equal("Zero.CType", context.getTypeInfoByTypeName('c:C').name); 24 | test.equal("Zero.DType", context.getTypeInfoByTypeName('orez:D').name); 25 | test.done(); 26 | } 27 | }; 28 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH61/Mappings.js: -------------------------------------------------------------------------------- 1 | var Zero = { 2 | name: "Zero", 3 | tns: "urn:orez", 4 | dens: "urn:zero", 5 | typeInfos: [{ 6 | type: "classInfo", 7 | localName: "AType" 8 | }, { 9 | type: "classInfo", 10 | localName: "BType", 11 | typeName: { lp : "B" } 12 | }, { 13 | type: "classInfo", 14 | localName: "CType", 15 | typeName: { ns: "urn:c", lp : "C" } 16 | }, { 17 | type: "classInfo", 18 | localName: "DType", 19 | typeName: "D" 20 | }] 21 | }; 22 | module.exports.Zero = Zero; 23 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH62/GH62.js: -------------------------------------------------------------------------------- 1 | var Jsonix = require("../../jsonix").Jsonix; 2 | var GH62 = require("./Mappings.js").GH62; 3 | 4 | module.exports = { 5 | "MarshallsWithPrefix" : function(test) { 6 | var context = new Jsonix.Context([GH62], { 7 | namespacePrefixes : { 8 | "urn:gh62" : "gh62" 9 | } 10 | }); 11 | var marshaller = context.createMarshaller(); 12 | var data = { 13 | name : { localPart : "root", namespaceURI : "urn:gh62" }, 14 | value : { 15 | toor : "orto" 16 | } 17 | }; 18 | var marshalled = marshaller.marshalString(data); 19 | test.equal("orto", marshalled); 20 | test.done(); 21 | }, 22 | "MarshallsWithoutPrefix" : function(test) { 23 | var context = new Jsonix.Context([GH62], { 24 | namespacePrefixes : { 25 | "urn:gh62" : "" 26 | } 27 | }); 28 | var marshaller = context.createMarshaller(); 29 | var data = { 30 | name : { localPart : "root", namespaceURI : "urn:gh62" }, 31 | value : { 32 | toor : "orto" 33 | } 34 | }; 35 | var marshalled = marshaller.marshalString(data); 36 | test.equal("orto", marshalled); 37 | test.done(); 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH62/Mappings.js: -------------------------------------------------------------------------------- 1 | var GH62 = { 2 | name: "GH62", 3 | dens: "urn:gh62", 4 | typeInfos: [{ 5 | type: "classInfo", 6 | localName: "Root", 7 | propertyInfos: [{ 8 | name: "toor" 9 | }] 10 | }], 11 | elementInfos: [{ 12 | elementName: "root", 13 | typeInfo: ".Root" 14 | }] 15 | 16 | }; 17 | module.exports.GH62 = GH62; 18 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH71/GH71.js: -------------------------------------------------------------------------------- 1 | var Jsonix = require("../../jsonix").Jsonix; 2 | var GH71 = require("./Mappings.js").GH71; 3 | 4 | module.exports = { 5 | "EmptyElement" : function(test) { 6 | var context = new Jsonix.Context([GH71]); 7 | var unmarshaller = context.createUnmarshaller(); 8 | var marshaller = context.createMarshaller(); 9 | var alpha = "config.xml"; 10 | var omega = "config.xml"; 11 | var unmarshalled = unmarshaller.unmarshalString(alpha); 12 | var marshalled = marshaller.marshalString(unmarshalled); 13 | test.equal(omega, marshalled); 14 | test.done(); 15 | } 16 | }; 17 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH71/Mappings.js: -------------------------------------------------------------------------------- 1 | var GH71 = { 2 | name: 'ConfigModel', 3 | typeInfos: [{ 4 | localName: 'Configuration.Install', 5 | propertyInfos: [{ 6 | name: 'configFile', 7 | elementName: { 8 | localPart: 'ConfigFile' 9 | } 10 | }, { 11 | name: 'installDir', 12 | elementName: { 13 | localPart: 'InstallDir', 14 | } 15 | }, { 16 | name: 'dataDir', 17 | elementName: { 18 | localPart: 'DataDir' 19 | } 20 | }, { 21 | name: 'date', 22 | elementName: { 23 | localPart: 'Date', 24 | typeInfo: 'Date' 25 | } 26 | }] 27 | }, { 28 | localName: 'Configuration', 29 | propertyInfos: [{ 30 | name: 'install', 31 | elementName: { 32 | localPart: 'Install' 33 | }, 34 | typeInfo: '.Configuration.Install' 35 | }] 36 | }], 37 | elementInfos: [{ 38 | elementName: { 39 | localPart: 'Configuration' 40 | }, 41 | typeInfo: '.Configuration' 42 | }] 43 | }; 44 | module.exports.GH71 = GH71; 45 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH73/GH73.js: -------------------------------------------------------------------------------- 1 | process.env.TZ = 'UTC'; 2 | 3 | module.exports = { 4 | "Issues" : { 5 | 6 | "GH73Core" : require('./GH73Core'), 7 | "GH73Calendar" : require('./GH73Calendar'), 8 | "GH73GYear" : require('./GH73GYear'), 9 | "GH73GYearMonth" : require('./GH73GYearMonth'), 10 | "GH73GMonth" : require('./GH73GMonth'), 11 | "GH73GMonthDay" : require('./GH73GMonthDay'), 12 | "GH73GDay" : require('./GH73GDay'), 13 | "GH73Regex" : require('./GH73Regex') 14 | 15 | } 16 | }; 17 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH73/GH73Calendar.js: -------------------------------------------------------------------------------- 1 | var Jsonix = require("../../jsonix").Jsonix; 2 | 3 | module.exports = { 4 | 5 | "ValidateMonthDay" : function(test) { 6 | var gMonthDay = Jsonix.Schema.XSD.Calendar.INSTANCE; 7 | 8 | test.doesNotThrow(function() { 9 | Jsonix.XML.Calendar.validateMonthDay(02, 29); 10 | }); 11 | 12 | test.throws(function() { 13 | Jsonix.XML.Calendar.validateMonthDay(02, 30); 14 | }, "Error"); 15 | 16 | test.throws(function() { 17 | Jsonix.XML.Calendar.validateMonthDay(04, 31); 18 | }, "Error"); 19 | 20 | test.throws(function() { 21 | Jsonix.XML.Calendar.validateMonthDay(11, 31); 22 | }, "Error"); 23 | 24 | test.doesNotThrow(function() { 25 | Jsonix.XML.Calendar.validateMonthDay(12, 31); 26 | }, "Error"); 27 | 28 | test.done(); 29 | } 30 | } -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH73/Mappings.js: -------------------------------------------------------------------------------- 1 | var GH73 = { 2 | name: 'GH73', 3 | typeInfos: [{ 4 | type: 'classInfo', 5 | localName: 'GDateTypes', 6 | propertyInfos: [ 7 | {name: 'yearMonth', typeInfo: 'GYearMonth', attributeName: 'yearMonth', type: 'attribute'}, 8 | {name: 'year', typeInfo: 'GYear', attributeName: 'year', type: 'attribute'}, 9 | {name: 'monthDay', typeInfo: 'GMonthDay', attributeName: 'monthDay', type: 'attribute'}, 10 | {name: 'month', typeInfo: 'GMonth', attributeName: 'month', type: 'attribute'}, 11 | {name: 'day', typeInfo: 'GDay', attributeName: 'day', type: 'attribute'} 12 | ] 13 | }], 14 | elementInfos: [{ 15 | elementName: 'GDateTypes', 16 | typeInfo: '.GDateTypes' 17 | }] 18 | }; 19 | if (typeof require === 'function') 20 | { 21 | module.exports.GH73 = GH73; 22 | } -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH83/GH83.js: -------------------------------------------------------------------------------- 1 | var Jsonix = require("../../jsonix").Jsonix; 2 | var roundtrips = require("../roundtrip").roundtrips; 3 | var comparisons = require("../comparison").comparisons; 4 | 5 | var ground = require("./ground.js"); 6 | 7 | var mappings = [ground.generated, ground.urban, ground.rural]; 8 | 9 | var context = new Jsonix.Context(mappings, { 10 | namespacePrefixes : { 11 | "urban" : "urban", 12 | "rural" : "rural" 13 | } 14 | }); 15 | 16 | module.exports = { 17 | "Standard" : { 18 | "Roundtrips" : roundtrips(__dirname, [context]), 19 | "Comparisons" : comparisons(__dirname, [context, ".json"]) 20 | } 21 | }; -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH83/ground.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": { 3 | "namespaceURI": "", 4 | "localPart": "Root", 5 | "prefix": "", 6 | "key": "Root", 7 | "string": "Root" 8 | }, 9 | "value": { 10 | "TYPE_NAME": "generated.Root", 11 | "house": { 12 | "TYPE_NAME": "generated.Root.House", 13 | "id": 1, 14 | "localisation": { 15 | "name": "Kleber", 16 | "oldName": "Kleb", 17 | "streetName": "MainStreet", 18 | "TYPE_NAME": "urban.LocaType" 19 | } 20 | }, 21 | "garden": { 22 | "TYPE_NAME": "generated.Root.Garden", 23 | "id": 2, 24 | "localisation": { 25 | "name": "Versailles", 26 | "swingCount": 3, 27 | "kennelCount": 5, 28 | "TYPE_NAME": "rural.LocaType" 29 | } 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH83/ground.xml: -------------------------------------------------------------------------------- 1 | 1KleberKlebMainStreet2Versailles35 -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH96/GH96.js: -------------------------------------------------------------------------------- 1 | var Jsonix = require("../../jsonix").Jsonix; 2 | var roundtrips = require("../roundtrip").roundtrips; 3 | var comparisons = require("../comparison").comparisons; 4 | 5 | var test_any = require("./test_any.js"); 6 | 7 | var mappings = [test_any.test_any]; 8 | 9 | var context = new Jsonix.Context(mappings, { 10 | namespacePrefixes : { 11 | "test:any" : "testany", 12 | } 13 | }); 14 | 15 | module.exports = { 16 | "Standard" : { 17 | "Roundtrips" : roundtrips(__dirname, [context]), 18 | "Comparisons" : comparisons(__dirname, [context, ".json"]) 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH96/test_any.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": { 3 | "namespaceURI": "test:any", 4 | "localPart": "TESTANY", 5 | "prefix": "testany", 6 | "key": "{test:any}TESTANY", 7 | "string": "{test:any}testany:TESTANY" 8 | }, 9 | "value": { 10 | "TYPE_NAME": "test_any.TESTANY", 11 | "en": { 12 | "TYPE_NAME": "test_any.MixedAnyType", 13 | "content": [ 14 | { 15 | "name": { 16 | "namespaceURI": "", 17 | "localPart": "INCLUDED", 18 | "prefix": "", 19 | "key": "INCLUDED", 20 | "string": "INCLUDED" 21 | }, 22 | "value": { 23 | "TYPE_NAME": "test_any.INCLUDED", 24 | "majorVersion": 1 25 | } 26 | } 27 | ] 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH96/test_any.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/GH96/test_any.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/forEachResourceInDirectory.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var forEachResourceInDirectory = function(directory, suffix, testFunction, args) { 3 | args = args || []; 4 | var testFunctionFactory = function(resource) { 5 | return function(test) { 6 | console.log('Testing [' + resource + '].'); 7 | var testFunctionArgs = [test]; 8 | testFunctionArgs.push(resource); 9 | // TODO there is a better way 10 | for (var i = 0; i < args.length; i++) 11 | { 12 | testFunctionArgs.push(args[i]); 13 | } 14 | testFunction.apply(null, testFunctionArgs); 15 | }; 16 | }; 17 | var files = fs.readdirSync(directory); 18 | var result = {}; 19 | for (var index = 0; index < files.length; index++) { 20 | var file = files[index]; 21 | if (file.indexOf(suffix, file.length - suffix.length) !== -1) { 22 | var resource = directory + '/' + file.substring(0, file.length - suffix.length); 23 | // console.log('Adding roundtrip test [' + resource + ']'); 24 | result[file] = testFunctionFactory(resource); 25 | } 26 | } 27 | return result; 28 | }; 29 | module.exports = forEachResourceInDirectory; 30 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/fs.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | module.exports = 3 | { 4 | "ReadFile": function(test) { 5 | // console.log('Reading [test0.xml].'); 6 | fs.readFile('tests/test0.xml', {encoding: 'utf8'}, function(err, data) { 7 | if (err) 8 | { 9 | throw err; 10 | } 11 | else 12 | { 13 | test.notEqual(null, data); 14 | var dataString = data.toString(); 15 | test.notEqual(null, dataString); 16 | // console.log('Read content:'); 17 | // console.log(dataString); 18 | test.equal(28, dataString.length); 19 | } 20 | test.ifError(err); 21 | test.done(); 22 | }); 23 | } 24 | }; -------------------------------------------------------------------------------- /nodejs/scripts/tests/issues.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "Issues" : { 3 | "GH56" : require('./GH56/GH56'), 4 | "GH61" : require('./GH61/GH61'), 5 | "GH62" : require('./GH62/GH62'), 6 | "GH70" : require('./GH70/GH70'), 7 | "GH71" : require('./GH71/GH71'), 8 | "GH73" : require('./GH73/GH73'), 9 | "GH83" : require('./GH83/GH83'), 10 | "GH96" : require('./GH96/GH96'), 11 | "GH111" : require('./GH111/GH111'), 12 | "GH135" : require('./GH135/GH135'), 13 | "GH141" : require('./GH141/GH141'), 14 | "GH150" : require('./GH150/GH150') 15 | } 16 | }; 17 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/nodejs.js: -------------------------------------------------------------------------------- 1 | module.exports = 2 | { 3 | "FS" : require('./fs') 4 | }; -------------------------------------------------------------------------------- /nodejs/scripts/tests/roundtrip.js: -------------------------------------------------------------------------------- 1 | var forEachResourceInDirectory = require('./forEachResourceInDirectory'); 2 | var Jsonix = require('../jsonix').Jsonix; 3 | var roundtrip = function(test, resource, context) { 4 | var xmlFile = resource + '.xml'; 5 | var unmarshallerOne = context.createUnmarshaller(); 6 | var unmarshallerTwo = context.createUnmarshaller(); 7 | var marshallerOne = context.createMarshaller(); 8 | var marshallerTwo = context.createMarshaller(); 9 | console.log('Unmarshalling [' + resource + '].'); 10 | unmarshallerOne.unmarshalFile(xmlFile, function(one) { 11 | console.log('Unmarshalled one:'); 12 | console.log(JSON.stringify(one, null, 4)); 13 | var documentOne = marshallerOne.marshalDocument(one); 14 | var two = unmarshallerTwo.unmarshalDocument(documentOne); 15 | console.log('Unmarshalled two:'); 16 | console.log(JSON.stringify(one, null, 4)); 17 | var stringTwo = marshallerTwo.marshalString(two); 18 | console.log('Marshalled two:'); 19 | console.log(JSON.stringify(stringTwo, null, 4)); 20 | test.ok(Jsonix.Util.Type.isEqual(one, two, function(text) { 21 | console.log(text); 22 | }), 'Roundtrip [' + resource + '] failed in phase two. Objects must be equal.'); 23 | test.done(); 24 | }); 25 | }; 26 | var roundtrips = function(directory, args) { 27 | return forEachResourceInDirectory(directory, ".xml", roundtrip, args); 28 | }; 29 | module.exports = { 30 | roundtrip : roundtrip, 31 | roundtrips : roundtrips 32 | } 33 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/schema.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "Schema": { 3 | "XSD" : require('./xsd') 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/test0.xml: -------------------------------------------------------------------------------- 1 | 2 | goo 3 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/test1.xml: -------------------------------------------------------------------------------- 1 | 2 | goo]]> 3 | -------------------------------------------------------------------------------- /nodejs/scripts/tests/tests.js: -------------------------------------------------------------------------------- 1 | process.on('uncaughtException', function(err) { 2 | console.error(err.stack); 3 | }); 4 | module.exports = 5 | { 6 | 7 | "Jsonix": { 8 | "Util" : require('./util'), 9 | "XML" : require('./xml'), 10 | "Schema" : require('./schema'), 11 | "NodeJS" : require('./nodejs'), 12 | "Request" : require('./request'), 13 | "SAX" : require('./sax'), 14 | "Issues" : require('./issues') 15 | } 16 | }; 17 | -------------------------------------------------------------------------------- /nodejs/tests/ar/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | -------------------------------------------------------------------------------- /nodejs/tests/ar/ar.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /nodejs/tests/ar/jsonix-tests-ar.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highsource/jsonix/5d0d101f338bcf514bb6249437860e4b4d011cd2/nodejs/tests/ar/jsonix-tests-ar.js -------------------------------------------------------------------------------- /nodejs/tests/ar/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jsonix-tests-ar", 3 | "description": "Jsonix Tests AR.", 4 | "version": "0.0.0", 5 | "engines": [ 6 | "node >= 0.8.0" 7 | ], 8 | "main": "index.js", 9 | "dependencies": { 10 | "jsonix": "file:../../scripts/jsonix-3.0.1-SNAPSHOT.tgz", 11 | "jsonix-schema-compiler": "2.x.x" 12 | }, 13 | "devDependencies": { 14 | "nodeunit": "0.x.x" 15 | }, 16 | "scripts": { 17 | "prepublish": "java -jar node_modules/jsonix-schema-compiler/lib/jsonix-schema-compiler-full.jar ar.xsd -p AR -logLevel TRACE", 18 | "test": "nodeunit tests/tests.js" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /nodejs/tests/ar/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | jsonix-nodejs-test-ar 4 | pom 5 | Jsonix Node.js Test [AR] 6 | 7 | org.hisrc.jsonix 8 | jsonix-nodejs-tests 9 | 3.0.1-SNAPSHOT 10 | 11 | 12 | 13 | 14 | org.codehaus.mojo 15 | exec-maven-plugin 16 | 17 | 18 | npm-install 19 | initialize 20 | 21 | 22 | npm-install-jsonix 23 | initialize 24 | 25 | 26 | test 27 | test 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /nodejs/tests/ar/tests/ar-tests.js: -------------------------------------------------------------------------------- 1 | var Jsonix = require('jsonix').Jsonix; 2 | var AR = require('../AR').AR; 3 | 4 | module.exports = { 5 | "UnmarshalFile": function(test) { 6 | 7 | // Create Jsonix context 8 | var context = new Jsonix.Context([ AR ]); 9 | 10 | // Create unmarshaller 11 | var unmarshaller = context.createUnmarshaller(); 12 | 13 | // Unmarshal the XML file 14 | unmarshaller.unmarshalFile( 'tests/sample01.xml', 15 | function(element) { 16 | console.log(element.value); 17 | test.equal('Status01', element.value.testCase[0].status); 18 | test.done(); 19 | }); 20 | } 21 | }; 22 | -------------------------------------------------------------------------------- /nodejs/tests/ar/tests/sample01.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1234 5 | 5678 6 | Status01 7 | 8 | 9 | true 10 | false 11 | Status02 12 | 13 | -------------------------------------------------------------------------------- /nodejs/tests/ar/tests/tests.js: -------------------------------------------------------------------------------- 1 | process.on('uncaughtException', function(err) { 2 | console.error(err.stack); 3 | }); 4 | module.exports = 5 | { 6 | "ar-tests": require('./ar-tests') 7 | }; 8 | -------------------------------------------------------------------------------- /nodejs/tests/basic/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | -------------------------------------------------------------------------------- /nodejs/tests/basic/README.md: -------------------------------------------------------------------------------- 1 | # Jsonix Tests Basic -------------------------------------------------------------------------------- /nodejs/tests/basic/jsonix-tests-basic.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highsource/jsonix/5d0d101f338bcf514bb6249437860e4b4d011cd2/nodejs/tests/basic/jsonix-tests-basic.js -------------------------------------------------------------------------------- /nodejs/tests/basic/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jsonix-tests-basic", 3 | "description": "Jsonix Tests Basic.", 4 | "engines": [ 5 | "node >= 0.8.0" 6 | ], 7 | "main": "jsonix-tests-basic.js", 8 | "dependencies": { 9 | "jsonix": "file:../../scripts/jsonix-3.0.1-SNAPSHOT.tgz" 10 | }, 11 | "devDependencies": { 12 | "nodeunit": "0.x.x", 13 | "node-static": "0.x.x" 14 | }, 15 | "scripts": { 16 | "test": "nodeunit tests/tests.js" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /nodejs/tests/basic/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | jsonix-nodejs-test-basic 4 | pom 5 | Jsonix Node.js Test [Basic] 6 | 7 | org.hisrc.jsonix 8 | jsonix-nodejs-tests 9 | 3.0.1-SNAPSHOT 10 | 11 | 12 | 13 | 14 | org.codehaus.mojo 15 | exec-maven-plugin 16 | 17 | 18 | npm-install 19 | initialize 20 | 21 | 22 | npm-install-jsonix 23 | initialize 24 | 25 | 26 | test 27 | test 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /nodejs/tests/basic/tests/PO/po-0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Alice Smith 4 | 123 Maple Street 5 | Mill Valley 6 | CA 7 | 90952 8 | 9 | 10 | Robert Smith 11 | 8 Oak Avenue 12 | Old Town 13 | PA 14 | 95819 15 | 16 | Hurry, my lawn is going wild! 17 | 18 | 19 | 20 | 21 | Lawnmower 22 | 1 23 | 148.95 24 | Confirm this is electric 25 | 26 | 27 | 28 | Baby Monitor 29 | 1 30 | 39.98 31 | 1999-05-21 32 | 33 | 34 | -------------------------------------------------------------------------------- /nodejs/tests/basic/tests/Two/attribute-0.xml: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /nodejs/tests/basic/tests/Two/customClassValue-0.xml: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /nodejs/tests/basic/tests/Two/element-0.xml: -------------------------------------------------------------------------------- 1 | 2 | one 3 | two 4 | three 5 | four five 6 | six seven 7 | eight nine 8 | -------------------------------------------------------------------------------- /nodejs/tests/basic/tests/Two/string-0.xml: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /nodejs/tests/basic/tests/Two/value-0.xml: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /nodejs/tests/basic/tests/XMLNS/Mappings.js: -------------------------------------------------------------------------------- 1 | var XMLNS = { 2 | n: 'XMLNS', 3 | dens: 'urn:test', 4 | tis : [{ 5 | ln : 'A', 6 | ps: [{ 7 | n : 'string' 8 | }, { 9 | n : 'b', 10 | ti : '.B', 11 | col : true 12 | }] 13 | }, { 14 | ln : 'B', 15 | ps: [{ 16 | n : 'string' 17 | }, { 18 | n : 'a', 19 | ti : '.A', 20 | col : true 21 | }] 22 | }], 23 | eis : [ { en: 'A', ti: '.A' }, { en: 'B', ti: '.B'}]}; 24 | module.exports.XMLNS = XMLNS; 25 | -------------------------------------------------------------------------------- /nodejs/tests/basic/tests/Zero/anyAttribute-0.xml: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /nodejs/tests/basic/tests/Zero/anyElementLax-0.xml: -------------------------------------------------------------------------------- 1 | 2 | test 3 | -------------------------------------------------------------------------------- /nodejs/tests/basic/tests/Zero/anyElementLax-1.xml: -------------------------------------------------------------------------------- 1 | 2 | test 3 | -------------------------------------------------------------------------------- /nodejs/tests/basic/tests/Zero/attribute-0.xml: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /nodejs/tests/basic/tests/Zero/attribute-1.xml: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /nodejs/tests/basic/tests/Zero/base-0.xml: -------------------------------------------------------------------------------- 1 | 2 | one 3 | 2 4 | 5 | -------------------------------------------------------------------------------- /nodejs/tests/basic/tests/Zero/element-0.xml: -------------------------------------------------------------------------------- 1 | 2 | one 3 | two 4 | three 5 | four five 6 | six seven 7 | eight nine 8 | -------------------------------------------------------------------------------- /nodejs/tests/basic/tests/Zero/elementRef-0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | one 4 | 2 5 | 6 | -------------------------------------------------------------------------------- /nodejs/tests/basic/tests/Zero/elementRef-1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | one 4 | 2 5 | 6 | 7 | one 8 | 2 9 | urn:three 10 | 2004-05-06 11 | 12 | -------------------------------------------------------------------------------- /nodejs/tests/basic/tests/Zero/elementRefMixed-0.xml: -------------------------------------------------------------------------------- 1 | 2 | abc 3 | -------------------------------------------------------------------------------- /nodejs/tests/basic/tests/Zero/elementRefs-0.xml: -------------------------------------------------------------------------------- 1 | 2 | one 3 | 2 4 | -------------------------------------------------------------------------------- /nodejs/tests/basic/tests/Zero/elements-0.xml: -------------------------------------------------------------------------------- 1 | 2 | one 3 | 2 4 | 3 5 | four 6 | -------------------------------------------------------------------------------- /nodejs/tests/basic/tests/Zero/extended-0.xml: -------------------------------------------------------------------------------- 1 | 2 | one 3 | 2 4 | urn:three 5 | 2004-05-06 6 | -------------------------------------------------------------------------------- /nodejs/tests/basic/tests/Zero/extendedExtended-0.xml: -------------------------------------------------------------------------------- 1 | 2 | one 3 | 2 4 | urn:three 5 | 2004-05-06 6 | 0.7 7 | 8 8 | -------------------------------------------------------------------------------- /nodejs/tests/basic/tests/Zero/simpleTypes-0.xml: -------------------------------------------------------------------------------- 1 | 2 | a:aq 3 | -------------------------------------------------------------------------------- /nodejs/tests/basic/tests/Zero/string-0.xml: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /nodejs/tests/basic/tests/Zero/value-0.xml: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /nodejs/tests/basic/tests/tests.js: -------------------------------------------------------------------------------- 1 | process.on('uncaughtException', function(err) { 2 | console.error(err.stack); 3 | }); 4 | 5 | var http = require('http'); 6 | var server; 7 | module.exports = 8 | { 9 | setUp: function(callback) 10 | { 11 | var nodeStaticServer = new(require('node-static').Server)('./tests'); 12 | server = http.createServer(function (request, response) { 13 | console.log('SERVER: Serving the request [' + request.url + '].'); 14 | nodeStaticServer.serve(request, response); 15 | }); 16 | console.log('SERVER: Launching the server.'); 17 | server.listen(8080); 18 | callback(); 19 | }, 20 | tearDown: function(callback) 21 | { 22 | console.log('SERVER: Closing the server.'); 23 | server.close(); 24 | callback(); 25 | }, 26 | "Jsonix-Tests": { 27 | "Zero" : require('./zero'), 28 | "One" : require('./one'), 29 | "Two" : require('./two'), 30 | "PO" : require('./po'), 31 | "XMLNS" : require('./xmlns'), 32 | "GH48" : require('./gh48'), 33 | "GH56" : require('./gh56') 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /nodejs/tests/basic/tests/xmlns.js: -------------------------------------------------------------------------------- 1 | var Jsonix = require('jsonix').Jsonix; 2 | var XMLNS = require('./XMLNS/Mappings').XMLNS; 3 | module.exports = 4 | { 5 | "Context" : function (test) 6 | { 7 | var context = new Jsonix.Context([ XMLNS ]); 8 | test.done(); 9 | }, 10 | "MarshalString" : function (test) 11 | { 12 | var context = new Jsonix.Context([ XMLNS ]); 13 | var data = { 14 | name : { ns : 'urn:test', lp : 'A' }, 15 | value : { 16 | string : 'a', 17 | b : [ { 18 | string : 'b', 19 | a : [ { string : 'ab1'}, { string : 'ab2'}] 20 | } ] 21 | } 22 | }; 23 | var marshaller = context.createMarshaller(); 24 | console.log(marshaller.marshalString(data)); 25 | test.done(); 26 | } 27 | }; 28 | -------------------------------------------------------------------------------- /nodejs/tests/browserify/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /bundle.js 3 | /PO.js 4 | -------------------------------------------------------------------------------- /nodejs/tests/browserify/README.md: -------------------------------------------------------------------------------- 1 | Jsonix Browserify Example 2 | ========================= 3 | 4 | Usage: 5 | 6 | * Run `npm install` - installs the scripts and generates XML/JSON mappings in the the `PO.js` file. 7 | * Run `browserify main.js -o bundle.js` - generates the `bundle.js` file. 8 | * Open `index.html` - includes the `bundle.js` script to unmarshal the `po.xml` file and set values in HTML elements. 9 | 10 | *Note for the Chrome users.* 11 | 12 | This example, when run locally, accesses a local xml file. 13 | This does not work in Chrome, you have to start Chrome with a special option: 14 | 15 | ```` 16 | chrome --allow-file-access-from-files 17 | ```` 18 | 19 | This is not a bug in Jsonix, this is a [feature](https://code.google.com/p/chromium/issues/detail?id=40787) in Chrome. -------------------------------------------------------------------------------- /nodejs/tests/browserify/bindings.xjb: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /nodejs/tests/browserify/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

Purchase order from

6 | 7 |

Please see po.xml.

8 | 9 |

Shipping address

10 | 11 |
12 |
Name
13 |
14 |
Street
15 |
16 |
City
17 |
18 |
State
19 |
20 |
Country
21 |
22 |
23 | 24 |

Billing address

25 | 26 |
27 |
Name
28 |
29 |
Street
30 |
31 |
City
32 |
33 |
State
34 |
35 |
Country
36 |
37 |
38 | 39 |

Purchase details

40 | 41 |
42 |
Number of items
43 |
44 |
Total price
45 |
46 |
47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /nodejs/tests/browserify/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jsonix-tests-browserify", 3 | "description": "Jsonix Tests Browserify.", 4 | "engines": [ 5 | "node >= 0.8.0" 6 | ], 7 | "main": "main.js", 8 | "dependencies": { 9 | "jsonix": "file:../../scripts/jsonix-3.0.1-SNAPSHOT.tgz", 10 | "jsonix-schema-compiler": "2.x.x" 11 | }, 12 | "devDependencies": { 13 | "nodeunit": "~0.x.x" 14 | }, 15 | "scripts": { 16 | "prepublish": "java -jar node_modules/jsonix-schema-compiler/lib/jsonix-schema-compiler-full.jar purchaseorder.xsd -b bindings.xjb" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /nodejs/tests/browserify/po.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Alice Smith 4 | 123 Maple Street 5 | Mill Valley 6 | CA 7 | 90952 8 | 9 | 10 | Robert Smith 11 | 8 Oak Avenue 12 | Old Town 13 | PA 14 | 95819 15 | 16 | Hurry, my lawn is going wild! 17 | 18 | 19 | Lawnmower 20 | 1 21 | 148.95 22 | Confirm this is electric 23 | 24 | 25 | Baby Monitor 26 | 1 27 | 39.98 28 | 1999-05-21 29 | 30 | 31 | -------------------------------------------------------------------------------- /nodejs/tests/po/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /jsonix-schema-compiler-full.jar 3 | -------------------------------------------------------------------------------- /nodejs/tests/po/README.md: -------------------------------------------------------------------------------- 1 | # Jsonix Tests PO -------------------------------------------------------------------------------- /nodejs/tests/po/bindings.xjb: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /nodejs/tests/po/jsonix-tests-po.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highsource/jsonix/5d0d101f338bcf514bb6249437860e4b4d011cd2/nodejs/tests/po/jsonix-tests-po.js -------------------------------------------------------------------------------- /nodejs/tests/po/mappings/.gitignore: -------------------------------------------------------------------------------- 1 | /PO.js 2 | /PO.jsonschema 3 | -------------------------------------------------------------------------------- /nodejs/tests/po/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jsonix-tests-po", 3 | "description": "Jsonix Tests PO.", 4 | "engines": [ 5 | "node >= 0.8.0" 6 | ], 7 | "main": "jsonix-tests-po.js", 8 | "dependencies": { 9 | "ajv": ">=1.2.1", 10 | "jsonix": "file:../../scripts/jsonix-3.0.1-SNAPSHOT.tgz", 11 | "jsonix-schema-compiler": ">=2.3.7" 12 | }, 13 | "devDependencies": { 14 | "nodeunit": "~0.x.x" 15 | }, 16 | "scripts": { 17 | "prepublish": "java -jar node_modules/jsonix-schema-compiler/lib/jsonix-schema-compiler-full.jar -generateJsonSchema -logLevel TRACE -d mappings purchaseorder.xsd -b bindings.xjb", 18 | "test": "nodeunit tests/tests.js" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /nodejs/tests/po/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | jsonix-nodejs-test-po 4 | pom 5 | Jsonix Node.js Test [PO] 6 | 7 | org.hisrc.jsonix 8 | jsonix-nodejs-tests 9 | 3.0.1-SNAPSHOT 10 | 11 | 12 | 13 | 14 | org.codehaus.mojo 15 | exec-maven-plugin 16 | 17 | 18 | npm-install 19 | initialize 20 | 21 | 22 | npm-install-jsonix 23 | initialize 24 | 25 | 26 | test 27 | test 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /nodejs/tests/po/tests/po.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Alice Smith 4 | 123 Maple Street 5 | Mill Valley 6 | CA 7 | 90952 8 | 9 | 10 | Robert Smith 11 | 8 Oak Avenue 12 | Old Town 13 | PA 14 | 95819 15 | 16 | Hurry, my lawn is going wild! 17 | 18 | 19 | Lawnmower 20 | 1 21 | 148.95 22 | Confirm this is electric 23 | 24 | 25 | Baby Monitor 26 | 1 27 | 39.98 28 | 1999-05-21 29 | 30 | 31 | -------------------------------------------------------------------------------- /nodejs/tests/po/tests/tests.js: -------------------------------------------------------------------------------- 1 | var http = require('http'); 2 | var server; 3 | module.exports = 4 | { 5 | "po-tests": require('./po-tests') 6 | }; 7 | -------------------------------------------------------------------------------- /nodejs/tests/wps/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | -------------------------------------------------------------------------------- /nodejs/tests/wps/README.md: -------------------------------------------------------------------------------- 1 | # Jsonix Tests WPS -------------------------------------------------------------------------------- /nodejs/tests/wps/catalog/catalog.cat: -------------------------------------------------------------------------------- 1 | -- 2 | If the parameter isn't working, this link to schema A is 3 | not recognized and the test will fail because of a missing schema. 4 | -- 5 | REWRITE_SYSTEM "http://www.w3.org" "../schemas/w3c" 6 | REWRITE_SYSTEM "http://schemas.opengis.net" "../schemas/ogc" 7 | 8 | -------------------------------------------------------------------------------- /nodejs/tests/wps/mappings/.gitignore: -------------------------------------------------------------------------------- 1 | /*.js 2 | -------------------------------------------------------------------------------- /nodejs/tests/wps/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jsonix-tests-wps", 3 | "description": "Jsonix Tests WPS.", 4 | "version": "2.1.1", 5 | "engines": [ 6 | "node >= 0.8.0" 7 | ], 8 | "main": "jsonix-tests-wps.js", 9 | "dependencies": { 10 | "jsonix": "file:../../scripts/jsonix-3.0.1-SNAPSHOT.tgz" 11 | }, 12 | "devDependencies": { 13 | "nodeunit": "~0.8.6", 14 | "node-static": "~0.7.3" 15 | }, 16 | "scripts": { 17 | "prepublish": "java -jar node_modules/jsonix/lib/jsonix-schema-compiler-full.jar -catalog catalog/catalog.cat -extension -d mappings schemas/ogc/wps/1.0.0/wpsAll.xsd -b bindings/bindings.xjb", 18 | "test": "nodeunit tests/tests.js" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /nodejs/tests/wps/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | jsonix-nodejs-test-wps 4 | pom 5 | Jsonix Node.js Test [WPS] 6 | 7 | org.hisrc.jsonix 8 | jsonix-nodejs-tests 9 | 3.0.1-SNAPSHOT 10 | 11 | 12 | 13 | ${project.groupId} 14 | jsonix-schema-compiler-full 15 | 16 | 17 | 18 | 19 | 20 | org.codehaus.mojo 21 | exec-maven-plugin 22 | 23 | 24 | npm-install 25 | initialize 26 | 27 | 28 | npm-install-jsonix 29 | initialize 30 | 31 | 32 | test 33 | test 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /nodejs/tests/wps/schemas/ogc/ows/1.1.0/Examples/exampleConstraint1.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 1 15 | 1000 16 | 17 | 18 | Maximum value of TBD 19 | urn:ogc:def:dataType:OGC:1.1:positiveInteger 20 | 21 | 22 | 23 | 1 24 | 25 | Maximum value of TBD 26 | urn:ogc:def:dataType:OGC:1.1:positiveInteger 27 | 28 | 29 | -------------------------------------------------------------------------------- /nodejs/tests/wps/schemas/ogc/ows/1.1.0/Examples/exampleExceptionReport1.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | service 9 | 10 | 11 | version 12 | 13 | 14 | -------------------------------------------------------------------------------- /nodejs/tests/wps/schemas/ogc/ows/1.1.0/Examples/exampleExceptionReport2.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /nodejs/tests/wps/schemas/ogc/ows/1.1.0/Examples/exampleGeneralBox2.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 189000 834000 7 | 285000 962000 8 | 9 | -------------------------------------------------------------------------------- /nodejs/tests/wps/schemas/ogc/ows/1.1.0/Examples/exampleGetCapabilities2.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 1.0.0 9 | 0.8.3 10 | 11 | 12 |
Contents
13 |
14 | 15 | text/xml 16 | 17 |
18 | -------------------------------------------------------------------------------- /nodejs/tests/wps/schemas/ogc/ows/1.1.0/Examples/exampleWGS84Box2.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -71.63 41.75 7 | -70.78 42.90 8 | 9 | -------------------------------------------------------------------------------- /nodejs/tests/wps/schemas/ogc/ows/1.1.0/owsAll.xsd: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | owsAll.xsd 8 | This XML Schema Document includes and imports, directly and indirectly, all the XML Schemas defined by the OWS Common Implemetation Specification. 9 | 10 | OWS is an OGC Standard. 11 | Copyright (c) 2006,2010 Open Geospatial Consortium. 12 | To obtain additional rights of use, visit http://www.opengeospatial.org/legal/ . 13 | 14 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /nodejs/tests/wps/schemas/ogc/wps/1.0.0/examples/10_wpsGetCapabilities_request.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 1.0.0 7 | 8 | 9 | -------------------------------------------------------------------------------- /nodejs/tests/wps/schemas/ogc/wps/1.0.0/examples/10_wpsGetCapabilities_request_SOAP.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 15 | 16 | 1.0.0 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /nodejs/tests/wps/schemas/ogc/wps/1.0.0/examples/30_wpsDescribeProcess_request.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | intersection 4 | union 5 | 6 | -------------------------------------------------------------------------------- /nodejs/tests/wps/schemas/ogc/wps/1.0.0/examples/30_wpsDescribeProcess_request_SOAP.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | intersection 14 | union 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /nodejs/tests/wps/schemas/ogc/wps/1.0.0/examples/90_wpsExceptionReport.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | Request is for an operation that is not supported by this server 6 | 7 | 8 | -------------------------------------------------------------------------------- /nodejs/tests/wps/schemas/ogc/wps/1.0.0/examples/MyComplexValueSchema.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /nodejs/tests/wps/schemas/ogc/wps/1.0.0/wpsAll.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $Id: wpsAll.xsd 2007-10-09 $ 5 | 6 | This XML Schema includes and imports, directly and indirectly, all the XML Schemas defined by the WPS Implemetation Specification. 7 | 8 | WPS is an OGC Standard. 9 | Copyright (c) 2007,2010 Open Geospatial Consortium. 10 | To obtain additional rights of use, visit http://www.opengeospatial.org/legal/ . 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /nodejs/tests/wps/tests/tests.js: -------------------------------------------------------------------------------- 1 | process.on('uncaughtException', function(err) { 2 | console.error(err.stack); 3 | }); 4 | module.exports = 5 | { 6 | "wps-tests": require('./wps-tests') 7 | }; 8 | -------------------------------------------------------------------------------- /scripts/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /scripts/JsTestDriver.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/highsource/jsonix/5d0d101f338bcf514bb6249437860e4b4d011cd2/scripts/JsTestDriver.jar -------------------------------------------------------------------------------- /scripts/server.bat: -------------------------------------------------------------------------------- 1 | start java -jar JsTestDriver.jar --port 9876 -------------------------------------------------------------------------------- /scripts/src/main/assembly/scripts.xml: -------------------------------------------------------------------------------- 1 | 2 | scripts 3 | 4 | zip 5 | tar.gz 6 | 7 | Jsonix-${project.version} 8 | 9 | 10 | 11 | README* 12 | LICENSE* 13 | NOTICE* 14 | 15 | 16 | 17 | src/main/javascript/org/hisrc/jsonix/Jsonix 18 | 19 | **/*.js 20 | 21 | lib/Jsonix 22 | 23 | 24 | src/main/javascript/org/hisrc/jsonix 25 | 26 | Jsonix.js 27 | 28 | lib 29 | 30 | 31 | target/classes/org/hisrc/jsonix 32 | 33 | Jsonix-all.js 34 | Jsonix-min.js 35 | 36 | / 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /scripts/src/main/java/org/hisrc/jsonix/JsonixScriptsConstants.java: -------------------------------------------------------------------------------- 1 | package org.hisrc.jsonix; 2 | 3 | public class JsonixScriptsConstants { 4 | 5 | public static final String PACKAGE_RESOURCE_NAME = JsonixScriptsConstants.class 6 | .getPackage().getName().replace('.', '/'); 7 | 8 | public static final String SCRIPTS_RESOURCE_NAME = "Jsonix.scripts"; //$NON-NLS-1$ 9 | 10 | public static final String MAIN_SCRIPT_RESOURCE_NAME = "Jsonix.js"; //$NON-NLS-1$ 11 | 12 | } 13 | -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Binding.js: -------------------------------------------------------------------------------- 1 | Jsonix.Binding = {}; -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Binding/Marshaller.js: -------------------------------------------------------------------------------- 1 | Jsonix.Binding.Marshaller = Jsonix.Class(Jsonix.Binding.Marshalls.Element, Jsonix.Binding.Marshalls.Element.AsElementRef, { 2 | context : null, 3 | initialize : function(context) { 4 | Jsonix.Util.Ensure.ensureObject(context); 5 | this.context = context; 6 | }, 7 | marshalString : function(value) { 8 | var doc = this.marshalDocument(value); 9 | var text = Jsonix.DOM.serialize(doc); 10 | return text; 11 | }, 12 | marshalDocument : function(value) { 13 | var output = new Jsonix.XML.Output({ 14 | namespacePrefixes : this.context.namespacePrefixes 15 | }); 16 | 17 | var doc = output.writeStartDocument(); 18 | this.marshalElement(value, this.context, output, undefined); 19 | output.writeEndDocument(); 20 | return doc; 21 | }, 22 | CLASS_NAME : 'Jsonix.Binding.Marshaller' 23 | }); 24 | Jsonix.Binding.Marshaller.Simplified = Jsonix.Class(Jsonix.Binding.Marshaller, { 25 | CLASS_NAME : 'Jsonix.Binding.Marshaller.Simplified' 26 | }); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Class.js: -------------------------------------------------------------------------------- 1 | Jsonix.Class = function() { 2 | var Class = function() { 3 | this.initialize.apply(this, arguments); 4 | }; 5 | var extended = {}; 6 | var empty = function() { 7 | }; 8 | var parent, initialize, Type; 9 | for (var i = 0, len = arguments.length; i < len; ++i) { 10 | Type = arguments[i]; 11 | if (typeof Type == "function") { 12 | // make the class passed as the first argument the superclass 13 | if (i === 0 && len > 1) { 14 | initialize = Type.prototype.initialize; 15 | // replace the initialize method with an empty function, 16 | // because we do not want to create a real instance here 17 | Type.prototype.initialize = empty; 18 | // the line below makes sure that the new class has a 19 | // superclass 20 | extended = new Type(); 21 | // restore the original initialize method 22 | if (initialize === undefined) { 23 | delete Type.prototype.initialize; 24 | } else { 25 | Type.prototype.initialize = initialize; 26 | } 27 | } 28 | // get the prototype of the superclass 29 | parent = Type.prototype; 30 | } else { 31 | // in this case we're extending with the prototype 32 | parent = Type; 33 | } 34 | Jsonix.Util.extend(extended, parent); 35 | } 36 | Class.prototype = extended; 37 | return Class; 38 | }; 39 | -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Jsonix.footer.fragmentjs: -------------------------------------------------------------------------------- 1 | // Complete Jsonix script is included above 2 | return { Jsonix: Jsonix }; 3 | }; 4 | 5 | // If the require function exists ... 6 | if (typeof require === 'function') { 7 | // ... but the define function does not exists 8 | if (typeof define !== 'function') { 9 | // Load the define function via amdefine 10 | var define = require('amdefine')(module); 11 | // If we're not in browser 12 | if (typeof window === 'undefined') 13 | { 14 | // Require xmldom, xmlhttprequest and fs 15 | define(["xmldom", "xmlhttprequest", "fs"], _jsonix_factory); 16 | } 17 | else 18 | { 19 | // We're probably in browser, maybe browserify 20 | // Do not require xmldom, xmlhttprequest as they'r provided by the browser 21 | // Do not require fs since file system is not available anyway 22 | define([], _jsonix_factory); 23 | } 24 | } 25 | else { 26 | // Otherwise assume we're in the browser/RequireJS environment 27 | // Load the module without xmldom and xmlhttprequests dependencies 28 | define([], _jsonix_factory); 29 | } 30 | } 31 | // If the require function does not exists, we're not in Node.js and therefore in browser environment 32 | else 33 | { 34 | // Just call the factory and set Jsonix as global. 35 | var Jsonix = _jsonix_factory().Jsonix; 36 | } -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Jsonix.header.fragmentjs: -------------------------------------------------------------------------------- 1 | var _jsonix_factory = function(_jsonix_xmldom, _jsonix_xmlhttprequest, _jsonix_fs) 2 | { 3 | // Complete Jsonix script is included below -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Mapping.js: -------------------------------------------------------------------------------- 1 | Jsonix.Mapping = {}; -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Mapping/Style.js: -------------------------------------------------------------------------------- 1 | Jsonix.Mapping.Style = Jsonix.Class({ 2 | marshaller : null, 3 | unmarshaller : null, 4 | module : null, 5 | elementInfo : null, 6 | classInfo : null, 7 | enumLeafInfo : null, 8 | anyAttributePropertyInfo : null, 9 | anyElementPropertyInfo : null, 10 | attributePropertyInfo : null, 11 | elementMapPropertyInfo : null, 12 | elementPropertyInfo : null, 13 | elementsPropertyInfo : null, 14 | elementRefPropertyInfo : null, 15 | elementRefsPropertyInfo : null, 16 | valuePropertyInfo : null, 17 | initialize : function() { 18 | }, 19 | CLASS_NAME : 'Jsonix.Mapping.Style' 20 | }); 21 | 22 | Jsonix.Mapping.Style.STYLES = {}; -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Mapping/Style/Simplified.js: -------------------------------------------------------------------------------- 1 | Jsonix.Mapping.Style.Simplified = Jsonix.Class(Jsonix.Mapping.Style, { 2 | marshaller : Jsonix.Binding.Marshaller.Simplified, 3 | unmarshaller : Jsonix.Binding.Unmarshaller.Simplified, 4 | module : Jsonix.Model.Module, 5 | elementInfo : Jsonix.Model.ElementInfo, 6 | classInfo : Jsonix.Model.ClassInfo, 7 | enumLeafInfo : Jsonix.Model.EnumLeafInfo, 8 | anyAttributePropertyInfo : Jsonix.Model.AnyAttributePropertyInfo.Simplified, 9 | anyElementPropertyInfo : Jsonix.Model.AnyElementPropertyInfo.Simplified, 10 | attributePropertyInfo : Jsonix.Model.AttributePropertyInfo, 11 | elementMapPropertyInfo : Jsonix.Model.ElementMapPropertyInfo, 12 | elementPropertyInfo : Jsonix.Model.ElementPropertyInfo, 13 | elementsPropertyInfo : Jsonix.Model.ElementsPropertyInfo, 14 | elementRefPropertyInfo : Jsonix.Model.ElementRefPropertyInfo.Simplified, 15 | elementRefsPropertyInfo : Jsonix.Model.ElementRefsPropertyInfo.Simplified, 16 | valuePropertyInfo : Jsonix.Model.ValuePropertyInfo, 17 | initialize : function() { 18 | Jsonix.Mapping.Style.prototype.initialize.apply(this); 19 | }, 20 | CLASS_NAME : 'Jsonix.Mapping.Style.Simplified' 21 | }); 22 | Jsonix.Mapping.Style.STYLES.simplified = new Jsonix.Mapping.Style.Simplified(); 23 | -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Mapping/Style/Standard.js: -------------------------------------------------------------------------------- 1 | Jsonix.Mapping.Style.Standard = Jsonix.Class(Jsonix.Mapping.Style, { 2 | marshaller : Jsonix.Binding.Marshaller, 3 | unmarshaller : Jsonix.Binding.Unmarshaller, 4 | module : Jsonix.Model.Module, 5 | elementInfo : Jsonix.Model.ElementInfo, 6 | classInfo : Jsonix.Model.ClassInfo, 7 | enumLeafInfo : Jsonix.Model.EnumLeafInfo, 8 | anyAttributePropertyInfo : Jsonix.Model.AnyAttributePropertyInfo, 9 | anyElementPropertyInfo : Jsonix.Model.AnyElementPropertyInfo, 10 | attributePropertyInfo : Jsonix.Model.AttributePropertyInfo, 11 | elementMapPropertyInfo : Jsonix.Model.ElementMapPropertyInfo, 12 | elementPropertyInfo : Jsonix.Model.ElementPropertyInfo, 13 | elementsPropertyInfo : Jsonix.Model.ElementsPropertyInfo, 14 | elementRefPropertyInfo : Jsonix.Model.ElementRefPropertyInfo, 15 | elementRefsPropertyInfo : Jsonix.Model.ElementRefsPropertyInfo, 16 | valuePropertyInfo : Jsonix.Model.ValuePropertyInfo, 17 | initialize : function() { 18 | Jsonix.Mapping.Style.prototype.initialize.apply(this); 19 | }, 20 | CLASS_NAME : 'Jsonix.Mapping.Style.Standard' 21 | }); 22 | Jsonix.Mapping.Style.STYLES.standard = new Jsonix.Mapping.Style.Standard(); 23 | -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Mapping/Styled.js: -------------------------------------------------------------------------------- 1 | Jsonix.Mapping.Styled = Jsonix.Class({ 2 | mappingStyle : null, 3 | initialize : function(options) { 4 | if (Jsonix.Util.Type.exists(options)) { 5 | Jsonix.Util.Ensure.ensureObject(options); 6 | if (Jsonix.Util.Type.isString(options.mappingStyle)) { 7 | var mappingStyle = Jsonix.Mapping.Style.STYLES[options.mappingStyle]; 8 | if (!mappingStyle) { 9 | throw new Error("Mapping style [" + options.mappingStyle + "] is not known."); 10 | } 11 | this.mappingStyle = mappingStyle; 12 | } else if (Jsonix.Util.Type.isObject(options.mappingStyle)) { 13 | this.mappingStyle = options.mappingStyle; 14 | } 15 | } 16 | if (!this.mappingStyle) { 17 | this.mappingStyle = Jsonix.Mapping.Style.STYLES.standard; 18 | } 19 | }, 20 | CLASS_NAME : 'Jsonix.Mapping.Styled' 21 | }); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Model.js: -------------------------------------------------------------------------------- 1 | Jsonix.Model = {}; -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Model/ElementInfo.js: -------------------------------------------------------------------------------- 1 | Jsonix.Model.ElementInfo = Jsonix.Class({ 2 | module: null, 3 | elementName : null, 4 | typeInfo : null, 5 | substitutionHead : null, 6 | scope : null, 7 | built : false, 8 | initialize : function(mapping) { 9 | Jsonix.Util.Ensure.ensureObject(mapping); 10 | 11 | var dens = mapping.defaultElementNamespaceURI||mapping.dens||''; 12 | this.defaultElementNamespaceURI = dens; 13 | 14 | var en = mapping.elementName || mapping.en||undefined; 15 | if (Jsonix.Util.Type.isObject(en)) { 16 | this.elementName = Jsonix.XML.QName.fromObject(en); 17 | } else { 18 | Jsonix.Util.Ensure.ensureString(en); 19 | this.elementName = new Jsonix.XML.QName(this.defaultElementNamespaceURI, en); 20 | } 21 | 22 | var ti = mapping.typeInfo||mapping.ti||'String'; 23 | this.typeInfo = ti; 24 | 25 | var sh = mapping.substitutionHead||mapping.sh||null; 26 | this.substitutionHead = sh; 27 | 28 | var sc = mapping.scope||mapping.sc||null; 29 | this.scope = sc; 30 | }, 31 | build : function(context) { 32 | // If element info is not yet built 33 | if (!this.built) { 34 | this.typeInfo = context.resolveTypeInfo(this.typeInfo, this.module); 35 | this.scope = context.resolveTypeInfo(this.scope, this.module); 36 | this.built = true; 37 | } 38 | }, 39 | CLASS_NAME : 'Jsonix.Model.ElementInfo' 40 | }); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Model/SingleTypePropertyInfo.js: -------------------------------------------------------------------------------- 1 | Jsonix.Model.SingleTypePropertyInfo = Jsonix.Class(Jsonix.Model.PropertyInfo, { 2 | typeInfo : 'String', 3 | initialize : function(mapping) { 4 | Jsonix.Util.Ensure.ensureObject(mapping); 5 | Jsonix.Model.PropertyInfo.prototype.initialize.apply(this, [ mapping ]); 6 | var ti = mapping.typeInfo || mapping.ti || 'String'; 7 | this.typeInfo = ti; 8 | }, 9 | doBuild : function(context, module) { 10 | this.typeInfo = context.resolveTypeInfo(this.typeInfo, module); 11 | }, 12 | unmarshalValue : function(value, context, input, scope) { 13 | return this.parse(value, context, input, scope); 14 | }, 15 | parse : function(value, context, input, scope) { 16 | return this.typeInfo.parse(value, context, input, scope); 17 | }, 18 | print : function(value, context, output, scope) { 19 | return this.typeInfo.reprint(value, context, output, scope); 20 | }, 21 | CLASS_NAME : 'Jsonix.Model.SingleTypePropertyInfo' 22 | }); 23 | -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Model/TypeInfo.js: -------------------------------------------------------------------------------- 1 | Jsonix.Model.TypeInfo = Jsonix.Class({ 2 | module: null, 3 | name : null, 4 | baseTypeInfo : null, 5 | initialize : function() { 6 | }, 7 | isBasedOn : function(typeInfo) { 8 | var currentTypeInfo = this; 9 | while (currentTypeInfo) { 10 | if (typeInfo === currentTypeInfo) { 11 | return true; 12 | } 13 | currentTypeInfo = currentTypeInfo.baseTypeInfo; 14 | } 15 | return false; 16 | }, 17 | CLASS_NAME : 'Jsonix.Model.TypeInfo' 18 | }); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema = {}; -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD = {}; 2 | Jsonix.Schema.XSD.NAMESPACE_URI = 'http://www.w3.org/2001/XMLSchema'; 3 | Jsonix.Schema.XSD.PREFIX = 'xsd'; 4 | Jsonix.Schema.XSD.qname = function(localPart) { 5 | Jsonix.Util.Ensure.ensureString(localPart); 6 | return new Jsonix.XML.QName(Jsonix.Schema.XSD.NAMESPACE_URI, localPart, 7 | Jsonix.Schema.XSD.PREFIX); 8 | }; 9 | -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/AnyType.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.AnyType = Jsonix.Class(Jsonix.Model.ClassInfo, { 2 | typeName : Jsonix.Schema.XSD.qname('anyType'), 3 | initialize : function() { 4 | Jsonix.Model.ClassInfo.prototype.initialize.call(this, { 5 | name : 'AnyType', 6 | propertyInfos : [ { 7 | type : 'anyAttribute', 8 | name : 'attributes' 9 | }, { 10 | type : 'anyElement', 11 | name : 'content', 12 | collection : true 13 | } ] 14 | }); 15 | }, 16 | CLASS_NAME : 'Jsonix.Schema.XSD.AnyType' 17 | }); 18 | Jsonix.Schema.XSD.AnyType.INSTANCE = new Jsonix.Schema.XSD.AnyType(); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/AnyURI.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.AnyURI = Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType, { 2 | name : 'AnyURI', 3 | typeName : Jsonix.Schema.XSD.qname('anyURI'), 4 | print : function(value, context, output, scope) { 5 | Jsonix.Util.Ensure.ensureString(value); 6 | return value; 7 | }, 8 | parse : function(text, context, input, scope) { 9 | Jsonix.Util.Ensure.ensureString(text); 10 | return text; 11 | }, 12 | isInstance : function(value, context, scope) { 13 | return Jsonix.Util.Type.isString(value); 14 | }, 15 | CLASS_NAME : 'Jsonix.Schema.XSD.AnyURI' 16 | }); 17 | Jsonix.Schema.XSD.AnyURI.INSTANCE = new Jsonix.Schema.XSD.AnyURI(); 18 | Jsonix.Schema.XSD.AnyURI.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.AnyURI.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/Boolean.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.Boolean = Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType, { 2 | name : 'Boolean', 3 | typeName : Jsonix.Schema.XSD.qname('boolean'), 4 | print : function(value, context, output, scope) { 5 | Jsonix.Util.Ensure.ensureBoolean(value); 6 | return value ? 'true' : 'false'; 7 | }, 8 | parse : function(text, context, input, scope) { 9 | Jsonix.Util.Ensure.ensureString(text); 10 | if (text === 'true' || text === '1') { 11 | return true; 12 | } else if (text === 'false' || text === '0') { 13 | return false; 14 | } else { 15 | throw new Error("Either [true], [1], [0] or [false] expected as boolean value."); 16 | } 17 | }, 18 | isInstance : function(value, context, scope) { 19 | return Jsonix.Util.Type.isBoolean(value); 20 | }, 21 | CLASS_NAME : 'Jsonix.Schema.XSD.Boolean' 22 | }); 23 | Jsonix.Schema.XSD.Boolean.INSTANCE = new Jsonix.Schema.XSD.Boolean(); 24 | Jsonix.Schema.XSD.Boolean.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Boolean.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/Byte.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.Byte = Jsonix.Class(Jsonix.Schema.XSD.Short, { 2 | name : 'Byte', 3 | typeName : Jsonix.Schema.XSD.qname('byte'), 4 | MIN_VALUE : -128, 5 | MAX_VALUE : 127, 6 | CLASS_NAME : 'Jsonix.Schema.XSD.Byte' 7 | }); 8 | Jsonix.Schema.XSD.Byte.INSTANCE = new Jsonix.Schema.XSD.Byte(); 9 | Jsonix.Schema.XSD.Byte.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Byte.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/Date.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.Date = Jsonix.Class(Jsonix.Schema.XSD.Calendar, { 2 | name : 'Date', 3 | typeName : Jsonix.Schema.XSD.qname('date'), 4 | parse : function(value, context, input, scope) { 5 | return this.parseDate(value); 6 | }, 7 | print : function(value, context, output, scope) { 8 | return this.printDate(value); 9 | }, 10 | CLASS_NAME : 'Jsonix.Schema.XSD.Date' 11 | }); 12 | Jsonix.Schema.XSD.Date.INSTANCE = new Jsonix.Schema.XSD.Date(); 13 | Jsonix.Schema.XSD.Date.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Date.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/DateTime.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.DateTime = Jsonix.Class(Jsonix.Schema.XSD.Calendar, { 2 | name : 'DateTime', 3 | typeName : Jsonix.Schema.XSD.qname('dateTime'), 4 | parse : function(value, context, input, scope) { 5 | return this.parseDateTime(value); 6 | }, 7 | print : function(value, context, output, scope) { 8 | return this.printDateTime(value); 9 | }, 10 | CLASS_NAME : 'Jsonix.Schema.XSD.DateTime' 11 | }); 12 | Jsonix.Schema.XSD.DateTime.INSTANCE = new Jsonix.Schema.XSD.DateTime(); 13 | Jsonix.Schema.XSD.DateTime.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.DateTime.INSTANCE); 14 | -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/Decimal.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.Decimal = Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType, { 2 | name : 'Decimal', 3 | typeName : Jsonix.Schema.XSD.qname('decimal'), 4 | print : function(value, context, output, scope) { 5 | Jsonix.Util.Ensure.ensureNumber(value); 6 | var text = String(value); 7 | return text; 8 | }, 9 | parse : function(text, context, input, scope) { 10 | Jsonix.Util.Ensure.ensureString(text); 11 | var value = Number(text); 12 | Jsonix.Util.Ensure.ensureNumber(value); 13 | return value; 14 | }, 15 | isInstance : function(value, context, scope) { 16 | return Jsonix.Util.Type.isNumber(value); 17 | }, 18 | CLASS_NAME : 'Jsonix.Schema.XSD.Decimal' 19 | }); 20 | Jsonix.Schema.XSD.Decimal.INSTANCE = new Jsonix.Schema.XSD.Decimal(); 21 | Jsonix.Schema.XSD.Decimal.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Decimal.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/Double.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.Double = Jsonix.Class(Jsonix.Schema.XSD.Number, { 2 | name : 'Double', 3 | typeName : Jsonix.Schema.XSD.qname('double'), 4 | isInstance : function(value, context, scope) { 5 | return Jsonix.Util.Type.isNaN(value) || value === -Infinity || value === Infinity || (Jsonix.Util.Type.isNumber(value) && value >= this.MIN_VALUE && value <= this.MAX_VALUE); 6 | }, 7 | MIN_VALUE : -1.7976931348623157e+308, 8 | MAX_VALUE : 1.7976931348623157e+308, 9 | CLASS_NAME : 'Jsonix.Schema.XSD.Double' 10 | }); 11 | Jsonix.Schema.XSD.Double.INSTANCE = new Jsonix.Schema.XSD.Double(); 12 | Jsonix.Schema.XSD.Double.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Double.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/Float.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.Float = Jsonix.Class(Jsonix.Schema.XSD.Number, { 2 | name : 'Float', 3 | typeName : Jsonix.Schema.XSD.qname('float'), 4 | isInstance : function(value, context, scope) { 5 | return Jsonix.Util.Type.isNaN(value) || value === -Infinity || value === Infinity || (Jsonix.Util.Type.isNumber(value) && value >= this.MIN_VALUE && value <= this.MAX_VALUE); 6 | }, 7 | MIN_VALUE : -3.4028235e+38, 8 | MAX_VALUE : 3.4028235e+38, 9 | CLASS_NAME : 'Jsonix.Schema.XSD.Float' 10 | }); 11 | Jsonix.Schema.XSD.Float.INSTANCE = new Jsonix.Schema.XSD.Float(); 12 | Jsonix.Schema.XSD.Float.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Float.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/GDay.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.GDay = Jsonix.Class(Jsonix.Schema.XSD.Calendar, { 2 | name : 'GDay', 3 | typeName : Jsonix.Schema.XSD.qname('gDay'), 4 | CLASS_NAME : 'Jsonix.Schema.XSD.GDay', 5 | 6 | parse : function(value, context, input, scope) { 7 | return this.parseGDay(value, context, input, scope); 8 | }, 9 | 10 | print : function(value, context, output, scope) { 11 | return this.printGDay(value, context, output, scope); 12 | } 13 | 14 | }); 15 | Jsonix.Schema.XSD.GDay.INSTANCE = new Jsonix.Schema.XSD.GDay(); 16 | Jsonix.Schema.XSD.GDay.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.GDay.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/GMonth.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.GMonth = Jsonix.Class(Jsonix.Schema.XSD.Calendar, { 2 | name : 'GMonth', 3 | typeName : Jsonix.Schema.XSD.qname('gMonth'), 4 | CLASS_NAME : 'Jsonix.Schema.XSD.GMonth', 5 | parse : function(value, context, input, scope) { 6 | return this.parseGMonth(value, context, input, scope); 7 | }, 8 | print : function(value, context, output, scope) { 9 | return this.printGMonth(value, context, output, scope); 10 | } 11 | }); 12 | Jsonix.Schema.XSD.GMonth.INSTANCE = new Jsonix.Schema.XSD.GMonth(); 13 | Jsonix.Schema.XSD.GMonth.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.GMonth.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/GMonthDay.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.GMonthDay = Jsonix.Class(Jsonix.Schema.XSD.Calendar, { 2 | name : 'GMonthDay', 3 | typeName : Jsonix.Schema.XSD.qname('gMonthDay'), 4 | CLASS_NAME : 'Jsonix.Schema.XSD.GMonthDay', 5 | 6 | parse : function(value, context, input, scope) { 7 | return this.parseGMonthDay(value, context, input, scope); 8 | }, 9 | 10 | print : function(value, context, output, scope) { 11 | return this.printGMonthDay(value, context, output, scope); 12 | } 13 | }); 14 | Jsonix.Schema.XSD.GMonthDay.INSTANCE = new Jsonix.Schema.XSD.GMonthDay(); 15 | Jsonix.Schema.XSD.GMonthDay.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.GMonthDay.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/GYear.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.GYear = Jsonix.Class(Jsonix.Schema.XSD.Calendar, { 2 | name : 'GYear', 3 | typeName : Jsonix.Schema.XSD.qname('gYear'), 4 | CLASS_NAME : 'Jsonix.Schema.XSD.GYear', 5 | 6 | parse : function(value, context, input, scope) { 7 | return this.parseGYear(value, context, input, scope); 8 | }, 9 | 10 | print : function(value, context, output, scope) { 11 | return this.printGYear(value, context, output, scope); 12 | } 13 | }); 14 | Jsonix.Schema.XSD.GYear.INSTANCE = new Jsonix.Schema.XSD.GYear(); 15 | Jsonix.Schema.XSD.GYear.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.GYear.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/GYearMonth.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.GYearMonth = Jsonix.Class(Jsonix.Schema.XSD.Calendar, { 2 | name : 'GYearMonth', 3 | typeName : Jsonix.Schema.XSD.qname('gYearMonth'), 4 | CLASS_NAME : 'Jsonix.Schema.XSD.GYearMonth', 5 | 6 | parse : function(value, context, input, scope) { 7 | return this.parseGYearMonth(value, context, input, scope); 8 | }, 9 | 10 | print : function(value, context, output, scope) { 11 | return this.printGYearMonth(value, context, output, scope); 12 | } 13 | 14 | }); 15 | Jsonix.Schema.XSD.GYearMonth.INSTANCE = new Jsonix.Schema.XSD.GYearMonth(); 16 | Jsonix.Schema.XSD.GYearMonth.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.GYearMonth.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/ID.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.ID = Jsonix.Class(Jsonix.Schema.XSD.String, { 2 | name : 'ID', 3 | typeName : Jsonix.Schema.XSD.qname('ID'), 4 | CLASS_NAME : 'Jsonix.Schema.XSD.ID' 5 | }); 6 | Jsonix.Schema.XSD.ID.INSTANCE = new Jsonix.Schema.XSD.ID(); 7 | Jsonix.Schema.XSD.ID.INSTANCE.LIST = new Jsonix.Schema.XSD.List( 8 | Jsonix.Schema.XSD.ID.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/IDREF.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.IDREF = Jsonix.Class(Jsonix.Schema.XSD.String, { 2 | name : 'IDREF', 3 | typeName : Jsonix.Schema.XSD.qname('IDREF'), 4 | CLASS_NAME : 'Jsonix.Schema.XSD.IDREF' 5 | }); 6 | Jsonix.Schema.XSD.IDREF.INSTANCE = new Jsonix.Schema.XSD.IDREF(); 7 | Jsonix.Schema.XSD.IDREF.INSTANCE.LIST = new Jsonix.Schema.XSD.List( 8 | Jsonix.Schema.XSD.IDREF.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/IDREFS.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.IDREFS = Jsonix.Class(Jsonix.Schema.XSD.List, { 2 | name : 'IDREFS', 3 | initialize : function() { 4 | Jsonix.Schema.XSD.List.prototype.initialize.apply(this, [ Jsonix.Schema.XSD.IDREF.INSTANCE, Jsonix.Schema.XSD.qname('IDREFS'), ' ' ]); 5 | }, 6 | // TODO Constraints 7 | CLASS_NAME : 'Jsonix.Schema.XSD.IDREFS' 8 | }); 9 | Jsonix.Schema.XSD.IDREFS.INSTANCE = new Jsonix.Schema.XSD.IDREFS(); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/Int.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.Int = Jsonix.Class(Jsonix.Schema.XSD.Long, { 2 | name : 'Int', 3 | typeName : Jsonix.Schema.XSD.qname('int'), 4 | MIN_VALUE : -2147483648, 5 | MAX_VALUE : 2147483647, 6 | CLASS_NAME : 'Jsonix.Schema.XSD.Int' 7 | }); 8 | Jsonix.Schema.XSD.Int.INSTANCE = new Jsonix.Schema.XSD.Int(); 9 | Jsonix.Schema.XSD.Int.INSTANCE.LIST = new Jsonix.Schema.XSD.List( 10 | Jsonix.Schema.XSD.Int.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/Integer.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.Integer = Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType, { 2 | name : 'Integer', 3 | typeName : Jsonix.Schema.XSD.qname('integer'), 4 | print : function(value, context, output, scope) { 5 | Jsonix.Util.Ensure.ensureInteger(value); 6 | var text = String(value); 7 | return text; 8 | }, 9 | parse : function(text, context, input, scope) { 10 | Jsonix.Util.Ensure.ensureString(text); 11 | var value = Number(text); 12 | Jsonix.Util.Ensure.ensureInteger(value); 13 | return value; 14 | }, 15 | isInstance : function(value, context, scope) { 16 | return Jsonix.Util.NumberUtils.isInteger(value) && value >= this.MIN_VALUE && value <= this.MAX_VALUE; 17 | }, 18 | MIN_VALUE : -9223372036854775808, 19 | MAX_VALUE : 9223372036854775807, 20 | CLASS_NAME : 'Jsonix.Schema.XSD.Integer' 21 | }); 22 | Jsonix.Schema.XSD.Integer.INSTANCE = new Jsonix.Schema.XSD.Integer(); 23 | Jsonix.Schema.XSD.Integer.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Integer.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/Language.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.Language = Jsonix.Class(Jsonix.Schema.XSD.Token, { 2 | name : 'Language', 3 | typeName : Jsonix.Schema.XSD.qname('language'), 4 | // TODO Constraints 5 | CLASS_NAME : 'Jsonix.Schema.XSD.Language' 6 | }); 7 | Jsonix.Schema.XSD.Language.INSTANCE = new Jsonix.Schema.XSD.Language(); 8 | Jsonix.Schema.XSD.Language.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Language.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/Long.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.Long = Jsonix.Class(Jsonix.Schema.XSD.Integer, { 2 | name : 'Long', 3 | typeName : Jsonix.Schema.XSD.qname('long'), 4 | MIN_VALUE : -9223372036854775808, 5 | MAX_VALUE : 9223372036854775807, 6 | CLASS_NAME : 'Jsonix.Schema.XSD.Long' 7 | }); 8 | Jsonix.Schema.XSD.Long.INSTANCE = new Jsonix.Schema.XSD.Long(); 9 | Jsonix.Schema.XSD.Long.INSTANCE.LIST = new Jsonix.Schema.XSD.List( 10 | Jsonix.Schema.XSD.Long.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/NCName.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.NCName = Jsonix.Class(Jsonix.Schema.XSD.Name, { 2 | name : 'NCName', 3 | typeName : Jsonix.Schema.XSD.qname('NCName'), 4 | // TODO Constraints 5 | CLASS_NAME : 'Jsonix.Schema.XSD.NCName' 6 | }); 7 | Jsonix.Schema.XSD.NCName.INSTANCE = new Jsonix.Schema.XSD.NCName(); 8 | Jsonix.Schema.XSD.NCName.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.NCName.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/NMToken.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.NMToken = Jsonix.Class(Jsonix.Schema.XSD.Token, { 2 | name : 'NMToken', 3 | typeName : Jsonix.Schema.XSD.qname('NMTOKEN'), 4 | // TODO Constraints 5 | CLASS_NAME : 'Jsonix.Schema.XSD.NMToken' 6 | }); 7 | Jsonix.Schema.XSD.NMToken.INSTANCE = new Jsonix.Schema.XSD.NMToken(); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/NMTokens.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.NMTokens = Jsonix.Class(Jsonix.Schema.XSD.List, { 2 | name : 'NMTokens', 3 | initialize : function() { 4 | Jsonix.Schema.XSD.List.prototype.initialize.apply(this, [ Jsonix.Schema.XSD.NMToken.INSTANCE, Jsonix.Schema.XSD.qname('NMTOKEN'), ' ' ]); 5 | }, 6 | // TODO Constraints 7 | CLASS_NAME : 'Jsonix.Schema.XSD.NMTokens' 8 | }); 9 | Jsonix.Schema.XSD.NMTokens.INSTANCE = new Jsonix.Schema.XSD.NMTokens(); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/Name.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.Name = Jsonix.Class(Jsonix.Schema.XSD.Token, { 2 | name : 'Name', 3 | typeName : Jsonix.Schema.XSD.qname('Name'), 4 | // TODO Constraints 5 | CLASS_NAME : 'Jsonix.Schema.XSD.Name' 6 | }); 7 | Jsonix.Schema.XSD.Name.INSTANCE = new Jsonix.Schema.XSD.Name(); 8 | Jsonix.Schema.XSD.Name.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Name.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/NegativeInteger.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.NegativeInteger = Jsonix.Class(Jsonix.Schema.XSD.NonPositiveInteger, { 2 | name : 'NegativeInteger', 3 | typeName : Jsonix.Schema.XSD.qname('negativeInteger'), 4 | MIN_VALUE: -9223372036854775808, 5 | MAX_VALUE: -1, 6 | CLASS_NAME : 'Jsonix.Schema.XSD.NegativeInteger' 7 | }); 8 | Jsonix.Schema.XSD.NegativeInteger.INSTANCE = new Jsonix.Schema.XSD.NegativeInteger(); 9 | Jsonix.Schema.XSD.NegativeInteger.INSTANCE.LIST = new Jsonix.Schema.XSD.List( 10 | Jsonix.Schema.XSD.NegativeInteger.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/NonNegativeInteger.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.NonNegativeInteger = Jsonix.Class(Jsonix.Schema.XSD.Integer, { 2 | name : 'NonNegativeInteger', 3 | typeName : Jsonix.Schema.XSD.qname('nonNegativeInteger'), 4 | MIN_VALUE: 0, 5 | MAX_VALUE: 9223372036854775807, 6 | CLASS_NAME : 'Jsonix.Schema.XSD.NonNegativeInteger' 7 | }); 8 | Jsonix.Schema.XSD.NonNegativeInteger.INSTANCE = new Jsonix.Schema.XSD.NonNegativeInteger(); 9 | Jsonix.Schema.XSD.NonNegativeInteger.INSTANCE.LIST = new Jsonix.Schema.XSD.List( 10 | Jsonix.Schema.XSD.NonNegativeInteger.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/NonPositiveInteger.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.NonPositiveInteger = Jsonix.Class(Jsonix.Schema.XSD.Integer, { 2 | name : 'NonPositiveInteger', 3 | typeName : Jsonix.Schema.XSD.qname('nonPositiveInteger'), 4 | MIN_VALUE: -9223372036854775808, 5 | MAX_VALUE: 0, 6 | CLASS_NAME : 'Jsonix.Schema.XSD.NonPositiveInteger' 7 | }); 8 | Jsonix.Schema.XSD.NonPositiveInteger.INSTANCE = new Jsonix.Schema.XSD.NonPositiveInteger(); 9 | Jsonix.Schema.XSD.NonPositiveInteger.INSTANCE.LIST = new Jsonix.Schema.XSD.List( 10 | Jsonix.Schema.XSD.NonPositiveInteger.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/NormalizedString.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.NormalizedString = Jsonix.Class(Jsonix.Schema.XSD.String, { 2 | name : 'NormalizedString', 3 | typeName : Jsonix.Schema.XSD.qname('normalizedString'), 4 | // TODO Constraints 5 | CLASS_NAME : 'Jsonix.Schema.XSD.NormalizedString' 6 | }); 7 | Jsonix.Schema.XSD.NormalizedString.INSTANCE = new Jsonix.Schema.XSD.NormalizedString(); 8 | Jsonix.Schema.XSD.NormalizedString.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.NormalizedString.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/Number.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.Number = Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType, { 2 | name : 'Number', 3 | typeName : Jsonix.Schema.XSD.qname('number'), 4 | print : function(value, context, output, scope) { 5 | Jsonix.Util.Ensure.ensureNumberOrNaN(value); 6 | if (Jsonix.Util.Type.isNaN(value)) { 7 | return 'NaN'; 8 | } else if (value === Infinity) { 9 | return 'INF'; 10 | } else if (value === -Infinity) { 11 | return '-INF'; 12 | } else { 13 | var text = String(value); 14 | return text; 15 | } 16 | }, 17 | parse : function(text, context, input, scope) { 18 | Jsonix.Util.Ensure.ensureString(text); 19 | if (text === '-INF') { 20 | return -Infinity; 21 | } else if (text === 'INF') { 22 | return Infinity; 23 | } else if (text === 'NaN') { 24 | return NaN; 25 | } else { 26 | var value = Number(text); 27 | Jsonix.Util.Ensure.ensureNumber(value); 28 | return value; 29 | } 30 | }, 31 | isInstance : function(value, context, scope) { 32 | return Jsonix.Util.Type.isNumberOrNaN(value); 33 | }, 34 | CLASS_NAME : 'Jsonix.Schema.XSD.Number' 35 | }); 36 | Jsonix.Schema.XSD.Number.INSTANCE = new Jsonix.Schema.XSD.Number(); 37 | Jsonix.Schema.XSD.Number.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Number.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/PositiveInteger.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.PositiveInteger = Jsonix.Class(Jsonix.Schema.XSD.NonNegativeInteger, { 2 | name : 'PositiveInteger', 3 | typeName : Jsonix.Schema.XSD.qname('positiveInteger'), 4 | MIN_VALUE : 1, 5 | MAX_VALUE : 9223372036854775807, 6 | CLASS_NAME : 'Jsonix.Schema.XSD.PositiveInteger' 7 | }); 8 | Jsonix.Schema.XSD.PositiveInteger.INSTANCE = new Jsonix.Schema.XSD.PositiveInteger(); 9 | Jsonix.Schema.XSD.PositiveInteger.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.PositiveInteger.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/Short.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.Short = Jsonix.Class(Jsonix.Schema.XSD.Int, { 2 | name : 'Short', 3 | typeName : Jsonix.Schema.XSD.qname('short'), 4 | MIN_VALUE : -32768, 5 | MAX_VALUE : 32767, 6 | CLASS_NAME : 'Jsonix.Schema.XSD.Short' 7 | }); 8 | Jsonix.Schema.XSD.Short.INSTANCE = new Jsonix.Schema.XSD.Short(); 9 | Jsonix.Schema.XSD.Short.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Short.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/String.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.String = Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType, { 2 | name : 'String', 3 | typeName : Jsonix.Schema.XSD.qname('string'), 4 | unmarshal : function(context, input, scope) { 5 | var text = input.getElementText(); 6 | return this.parse(text, context, input, scope); 7 | }, 8 | print : function(value, context, output, scope) { 9 | Jsonix.Util.Ensure.ensureString(value); 10 | return value; 11 | }, 12 | parse : function(text, context, input, scope) { 13 | Jsonix.Util.Ensure.ensureString(text); 14 | return text; 15 | }, 16 | isInstance : function(value, context, scope) { 17 | return Jsonix.Util.Type.isString(value); 18 | }, 19 | CLASS_NAME : 'Jsonix.Schema.XSD.String' 20 | }); 21 | Jsonix.Schema.XSD.String.INSTANCE = new Jsonix.Schema.XSD.String(); 22 | Jsonix.Schema.XSD.String.INSTANCE.LIST = new Jsonix.Schema.XSD.List( 23 | Jsonix.Schema.XSD.String.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/Strings.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.Strings = Jsonix.Class(Jsonix.Schema.XSD.List, { 2 | name : 'Strings', 3 | initialize : function() { 4 | Jsonix.Schema.XSD.List.prototype.initialize.apply(this, [ Jsonix.Schema.XSD.String.INSTANCE, Jsonix.Schema.XSD.qname('strings'), ' ' ]); 5 | }, 6 | // TODO Constraints 7 | CLASS_NAME : 'Jsonix.Schema.XSD.Strings' 8 | }); 9 | Jsonix.Schema.XSD.Strings.INSTANCE = new Jsonix.Schema.XSD.Strings(); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/Time.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.Time = Jsonix.Class(Jsonix.Schema.XSD.Calendar, { 2 | name : 'Time', 3 | typeName : Jsonix.Schema.XSD.qname('time'), 4 | parse : function(value, context, input, scope) { 5 | return this.parseTime(value); 6 | }, 7 | print : function(value, context, output, scope) { 8 | return this.printTime(value); 9 | }, 10 | CLASS_NAME : 'Jsonix.Schema.XSD.Time' 11 | }); 12 | Jsonix.Schema.XSD.Time.INSTANCE = new Jsonix.Schema.XSD.Time(); 13 | Jsonix.Schema.XSD.Time.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Time.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/Token.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.Token = Jsonix.Class(Jsonix.Schema.XSD.NormalizedString, { 2 | name : 'Token', 3 | typeName : Jsonix.Schema.XSD.qname('token'), 4 | // TODO Constraints 5 | CLASS_NAME : 'Jsonix.Schema.XSD.Token' 6 | }); 7 | Jsonix.Schema.XSD.Token.INSTANCE = new Jsonix.Schema.XSD.Token(); 8 | Jsonix.Schema.XSD.Token.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.Token.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/UnsignedByte.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.UnsignedByte = Jsonix.Class(Jsonix.Schema.XSD.UnsignedShort, { 2 | name : 'UnsignedByte', 3 | typeName : Jsonix.Schema.XSD.qname('unsignedByte'), 4 | MIN_VALUE : 0, 5 | MAX_VALUE : 255, 6 | CLASS_NAME : 'Jsonix.Schema.XSD.UnsignedByte' 7 | }); 8 | Jsonix.Schema.XSD.UnsignedByte.INSTANCE = new Jsonix.Schema.XSD.UnsignedByte(); 9 | Jsonix.Schema.XSD.UnsignedByte.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.UnsignedByte.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/UnsignedInt.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.UnsignedInt = Jsonix.Class(Jsonix.Schema.XSD.UnsignedLong, { 2 | name : 'UnsignedInt', 3 | typeName : Jsonix.Schema.XSD.qname('unsignedInt'), 4 | MIN_VALUE : 0, 5 | MAX_VALUE : 4294967295, 6 | CLASS_NAME : 'Jsonix.Schema.XSD.UnsignedInt' 7 | }); 8 | Jsonix.Schema.XSD.UnsignedInt.INSTANCE = new Jsonix.Schema.XSD.UnsignedInt(); 9 | Jsonix.Schema.XSD.UnsignedInt.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.UnsignedInt.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/UnsignedLong.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.UnsignedLong = Jsonix.Class(Jsonix.Schema.XSD.NonNegativeInteger, { 2 | name : 'UnsignedLong', 3 | typeName : Jsonix.Schema.XSD.qname('unsignedLong'), 4 | MIN_VALUE : 0, 5 | MAX_VALUE : 18446744073709551615, 6 | CLASS_NAME : 'Jsonix.Schema.XSD.UnsignedLong' 7 | }); 8 | Jsonix.Schema.XSD.UnsignedLong.INSTANCE = new Jsonix.Schema.XSD.UnsignedLong(); 9 | Jsonix.Schema.XSD.UnsignedLong.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.UnsignedLong.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSD/UnsignedShort.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSD.UnsignedShort = Jsonix.Class(Jsonix.Schema.XSD.UnsignedInt, { 2 | name : 'UnsignedShort', 3 | typeName : Jsonix.Schema.XSD.qname('unsignedShort'), 4 | MIN_VALUE : 0, 5 | MAX_VALUE : 65535, 6 | CLASS_NAME : 'Jsonix.Schema.XSD.UnsignedShort' 7 | }); 8 | Jsonix.Schema.XSD.UnsignedShort.INSTANCE = new Jsonix.Schema.XSD.UnsignedShort(); 9 | Jsonix.Schema.XSD.UnsignedShort.INSTANCE.LIST = new Jsonix.Schema.XSD.List(Jsonix.Schema.XSD.UnsignedShort.INSTANCE); -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Schema/XSI.js: -------------------------------------------------------------------------------- 1 | Jsonix.Schema.XSI = {}; 2 | Jsonix.Schema.XSI.NAMESPACE_URI = 'http://www.w3.org/2001/XMLSchema-instance'; 3 | Jsonix.Schema.XSI.PREFIX = 'xsi'; 4 | Jsonix.Schema.XSI.TYPE = 'type'; 5 | Jsonix.Schema.XSI.NIL = 'nil'; 6 | Jsonix.Schema.XSI.qname = function(localPart) { 7 | Jsonix.Util.Ensure.ensureString(localPart); 8 | return new Jsonix.XML.QName(Jsonix.Schema.XSI.NAMESPACE_URI, localPart, 9 | Jsonix.Schema.XSI.PREFIX); 10 | }; 11 | Jsonix.Schema.XSI.TYPE_QNAME = Jsonix.Schema.XSI.qname(Jsonix.Schema.XSI.TYPE); 12 | -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/SingleFile.js: -------------------------------------------------------------------------------- 1 | var Jsonix = { 2 | singleFile : true 3 | }; -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Util.js: -------------------------------------------------------------------------------- 1 | Jsonix.Util = {}; 2 | 3 | Jsonix.Util.extend = function(destination, source) { 4 | destination = destination || {}; 5 | if (source) { 6 | /*jslint forin: true */ 7 | for ( var property in source) { 8 | var value = source[property]; 9 | if (value !== undefined) { 10 | destination[property] = value; 11 | } 12 | } 13 | 14 | /** 15 | * IE doesn't include the toString property when iterating over an 16 | * object's properties with the for(property in object) syntax. 17 | * Explicitly check if the source has its own toString property. 18 | */ 19 | 20 | /* 21 | * FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative 22 | * prototype object" when calling hawOwnProperty if the source object is 23 | * an instance of window.Event. 24 | */ 25 | 26 | // REWORK 27 | // Node.js 28 | sourceIsEvt = typeof window !== 'undefined' && window !== null && typeof window.Event === "function" && source instanceof window.Event; 29 | 30 | if (!sourceIsEvt && source.hasOwnProperty && source.hasOwnProperty('toString')) { 31 | destination.toString = source.toString; 32 | } 33 | } 34 | return destination; 35 | }; -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/Util/NumberUtils.js: -------------------------------------------------------------------------------- 1 | Jsonix.Util.NumberUtils = { 2 | isInteger : function(value) { 3 | return Jsonix.Util.Type.isNumber(value) && ((value % 1) === 0); 4 | } 5 | }; -------------------------------------------------------------------------------- /scripts/src/main/javascript/org/hisrc/jsonix/Jsonix/XML.js: -------------------------------------------------------------------------------- 1 | Jsonix.XML = { 2 | XMLNS_NS : 'http://www.w3.org/2000/xmlns/', 3 | XMLNS_P : 'xmlns' 4 | }; 5 | 6 | -------------------------------------------------------------------------------- /scripts/src/main/resources/org/hisrc/jsonix/Footer.scripts: -------------------------------------------------------------------------------- 1 | /org/hisrc/jsonix/Jsonix/Jsonix.footer.fragmentjs -------------------------------------------------------------------------------- /scripts/src/main/resources/org/hisrc/jsonix/Header.scripts: -------------------------------------------------------------------------------- 1 | /org/hisrc/jsonix/Jsonix/Jsonix.header.fragmentjs -------------------------------------------------------------------------------- /scripts/src/main/resources/org/hisrc/jsonix/Jsonix.complete.scripts: -------------------------------------------------------------------------------- 1 | /org/hisrc/jsonix/SingleFile.scripts 2 | /org/hisrc/jsonix/Jsonix.scripts -------------------------------------------------------------------------------- /scripts/src/main/resources/org/hisrc/jsonix/SingleFile.scripts: -------------------------------------------------------------------------------- 1 | /org/hisrc/jsonix/Jsonix/SingleFile.js -------------------------------------------------------------------------------- /scripts/src/main/webapp/xmlns.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 15 | 16 | -------------------------------------------------------------------------------- /scripts/src/test/java/org/hisrc/jsonix/samples/test/SamplesAllTest.java: -------------------------------------------------------------------------------- 1 | package org.hisrc.jsonix.samples.test; 2 | 3 | import net.disy.legato.testing.script.AbstractJsUnitScriptTest; 4 | 5 | import com.gargoylesoftware.htmlunit.BrowserVersion; 6 | 7 | public class SamplesAllTest extends AbstractJsUnitScriptTest { 8 | 9 | @Override 10 | public BrowserVersion getBrowserVersion() { 11 | return BrowserVersion.FIREFOX_3; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /scripts/src/test/java/org/hisrc/jsonix/samples/test/SamplesMinTest.java: -------------------------------------------------------------------------------- 1 | package org.hisrc.jsonix.samples.test; 2 | 3 | import net.disy.legato.testing.script.AbstractJsUnitScriptTest; 4 | 5 | import com.gargoylesoftware.htmlunit.BrowserVersion; 6 | 7 | public class SamplesMinTest extends AbstractJsUnitScriptTest { 8 | 9 | @Override 10 | public BrowserVersion getBrowserVersion() { 11 | return BrowserVersion.FIREFOX_3; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /scripts/src/test/java/org/hisrc/jsonix/samples/test/SamplesTest.java: -------------------------------------------------------------------------------- 1 | package org.hisrc.jsonix.samples.test; 2 | 3 | import net.disy.legato.testing.script.AbstractJsUnitScriptTest; 4 | 5 | import com.gargoylesoftware.htmlunit.BrowserVersion; 6 | 7 | public class SamplesTest extends AbstractJsUnitScriptTest { 8 | 9 | @Override 10 | public BrowserVersion getBrowserVersion() { 11 | return BrowserVersion.FIREFOX_3; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /scripts/src/test/java/org/hisrc/jsonix/test/JsonixTest.java: -------------------------------------------------------------------------------- 1 | package org.hisrc.jsonix.test; 2 | 3 | import net.disy.legato.testing.script.AbstractJsUnitScriptTest; 4 | 5 | import com.gargoylesoftware.htmlunit.BrowserVersion; 6 | 7 | public class JsonixTest extends AbstractJsUnitScriptTest { 8 | 9 | @Override 10 | public BrowserVersion getBrowserVersion() { 11 | return BrowserVersion.FIREFOX_3; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /scripts/src/test/javascript/net/opengis/wps/v_1_0_0/WPSTests.js: -------------------------------------------------------------------------------- 1 | function testWPSMarhshal1() { 2 | var context = new Jsonix.Context([ WPS_V_1_0_0 ], { 3 | namespacePrefixes : { 4 | 'http://www.opengis.net/wps/1.0.0' : 'wps', 5 | 'urn:test' : 'test' 6 | } 7 | }); 8 | var marshaller = context.createMarshaller(); 9 | var value = { 10 | name : { 11 | namespaceURI : 'http://www.opengis.net/wps/1.0.0', 12 | localPart : 'GetCapabilities' 13 | }, 14 | value : { 15 | language : 'en-CA', 16 | service : 'WPS', 17 | acceptVersions : { 18 | version : [ '1.0.0', '1.0.1' ] 19 | } 20 | } 21 | }; 22 | var node = marshaller.marshalDocument(value); 23 | var serializedNode = Jsonix.DOM.serialize(node); 24 | logger.debug(serializedNode); 25 | assertTrue(serializedNode.length > 5); 26 | assertTrue(serializedNode.indexOf('xmlns:test="urn:test"') >= 0); 27 | } -------------------------------------------------------------------------------- /scripts/src/test/javascript/org/hisrc/jsonix/samples/test/SamplesAllTest.scripts: -------------------------------------------------------------------------------- 1 | /org/hisrc/jsonix/Jsonix-all.js 2 | SamplesTest.test.scripts -------------------------------------------------------------------------------- /scripts/src/test/javascript/org/hisrc/jsonix/samples/test/SamplesMinTest.scripts: -------------------------------------------------------------------------------- 1 | /org/hisrc/jsonix/Jsonix-min.js 2 | SamplesTest.test.scripts -------------------------------------------------------------------------------- /scripts/src/test/javascript/org/hisrc/jsonix/samples/test/SamplesTest.scripts: -------------------------------------------------------------------------------- 1 | /org/hisrc/jsonix/Jsonix.complete.scripts 2 | SamplesTest.test.scripts -------------------------------------------------------------------------------- /scripts/src/test/javascript/org/hisrc/jsonix/samples/test/SamplesTest.test.scripts: -------------------------------------------------------------------------------- 1 | /org/hisrc/jsonix/samples/po/PO.js 2 | /org/hisrc/jsonix/samples/po/test/POTest.js 3 | /org/hisrc/jsonix/samples/one/One.js 4 | /org/hisrc/jsonix/samples/one/test/OneTest.js 5 | /org/hisrc/jsonix/samples/three/Three.js 6 | /org/hisrc/jsonix/samples/three/test/ThreeTest.js 7 | /org/hisrc/jsonix/samples/five/Five.js 8 | /org/hisrc/jsonix/samples/five/test/FiveTest.js 9 | /net/opengis/wps/v_1_0_0/WPS_V_1_0_0.js 10 | /net/opengis/wps/v_1_0_0/WPSTests.js -------------------------------------------------------------------------------- /scripts/src/test/javascript/org/hisrc/jsonix/test/JsonixContextTest.js: -------------------------------------------------------------------------------- 1 | function testJsonixContextgetBuiltinTypeInfo() { 2 | var context = new Jsonix.Context(); 3 | assertNotNull(context); 4 | } 5 | -------------------------------------------------------------------------------- /scripts/src/test/javascript/org/hisrc/jsonix/test/JsonixRequestTest.js: -------------------------------------------------------------------------------- 1 | function testSync() { 2 | 3 | var request = Jsonix.Request.INSTANCE; 4 | 5 | var transport = request.issue('test0.xml', function(result) { 6 | logger.info('Response text:' + result.responseText); 7 | }, null, { 8 | async : false 9 | }); 10 | } 11 | 12 | function testSyncDOM() { 13 | Jsonix.DOM.load('test0.xml', function(doc) { 14 | logger.info('Loaded document:' + doc); 15 | 16 | }, { 17 | async : false 18 | }); 19 | 20 | } -------------------------------------------------------------------------------- /scripts/src/test/javascript/org/hisrc/jsonix/test/JsonixTest.js: -------------------------------------------------------------------------------- 1 | function testJsonix() { 2 | assertNotNull(Jsonix); 3 | logger.debug("Ok."); 4 | } 5 | -------------------------------------------------------------------------------- /scripts/src/test/javascript/org/hisrc/jsonix/test/JsonixTest.jstd.js: -------------------------------------------------------------------------------- 1 | JsonixTest = TestCase("JsonixTest"); 2 | 3 | JsonixTest.prototype.testJsonix = function() { 4 | assertNotNull(Jsonix); 5 | var t = Jsonix.Schema.XSD.String.INSTANCE; 6 | assertEquals('test', t.print('test')); 7 | assertEquals('test', t.parse('test')); 8 | 9 | }; -------------------------------------------------------------------------------- /scripts/src/test/javascript/org/hisrc/jsonix/test/JsonixTest.scripts: -------------------------------------------------------------------------------- 1 | /org/hisrc/jsonix/SingleFile.scripts 2 | /org/hisrc/jsonix/Jsonix.complete.scripts 3 | JsonixTest.test.scripts -------------------------------------------------------------------------------- /scripts/src/test/javascript/org/hisrc/jsonix/test/JsonixTest.test.scripts: -------------------------------------------------------------------------------- 1 | JsonixTest.js 2 | JsonixUtilTest.js 3 | JsonixXMLTest.js 4 | JsonixRequestTest.js 5 | JsonixSchemaXSDTest.js 6 | JsonixContextTest.js -------------------------------------------------------------------------------- /scripts/src/test/javascript/org/hisrc/jsonix/test/JsonixUtilTest.js: -------------------------------------------------------------------------------- 1 | function testUtilType() { 2 | assertTrue(Jsonix.Util.Type.isString('abc')); 3 | assertFalse(Jsonix.Util.Type.isString(1)); 4 | assertFalse(Jsonix.Util.Type.isString(null)); 5 | assertFalse(Jsonix.Util.Type.isString(undefined)); 6 | // 7 | assertTrue(Jsonix.Util.Type.isBoolean(true)); 8 | assertTrue(Jsonix.Util.Type.isBoolean(true)); 9 | assertFalse(Jsonix.Util.Type.isBoolean('true')); 10 | // 11 | assertTrue(Jsonix.Util.Type.isNumber(0)); 12 | assertTrue(Jsonix.Util.Type.isNumber(1.2)); 13 | assertFalse(Jsonix.Util.Type.isNumber(Number('1..2'))); 14 | assertFalse(Jsonix.Util.Type.isNumber('1.2')); 15 | 16 | assertTrue(Jsonix.Util.Type.isArray([])); 17 | assertTrue(Jsonix.Util.Type.isArray([0])); 18 | assertFalse(Jsonix.Util.Type.isArray(0)); 19 | 20 | assertTrue(Jsonix.Util.Type.isNumberOrNaN(Number.NaN)); 21 | assertTrue(Jsonix.Util.Type.isNaN(Number.NaN)); 22 | assertFalse(Jsonix.Util.Type.isNumber(Number.NaN)); 23 | } 24 | function testUtilStringUtils() { 25 | assertEquals('a b c', Jsonix.Util.StringUtils.trim(' a b c ')); 26 | assertTrue(Jsonix.Util.StringUtils.isEmpty(' ')); 27 | assertTrue(Jsonix.Util.StringUtils.isEmpty(Jsonix.Util.StringUtils.whitespaceCharacters)); 28 | 29 | } -------------------------------------------------------------------------------- /scripts/src/test/javascript/org/hisrc/jsonix/test/JsonixXMLInputTest.jstd.js: -------------------------------------------------------------------------------- 1 | JsonixXMLInputTest = TestCase("JsonixXMLInputTest"); 2 | 3 | JsonixXMLInputTest.prototype.testGetAttributeValueNS = function() { 4 | 5 | assertNotNull(Jsonix); 6 | var doc = Jsonix.DOM 7 | .parse(''); 8 | var input = new Jsonix.XML.Input(doc.documentElement); 9 | input.nextTag(); 10 | assertEquals("Literal", input.getAttributeNodeNS("http://www.w3.org/2001/XMLSchema-instance", "type").nodeValue); 11 | assertEquals("Literal", input.getAttributeValueNS("http://www.w3.org/2001/XMLSchema-instance", "type")); 12 | }; -------------------------------------------------------------------------------- /scripts/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootCategory=DEBUG, stdout 2 | 3 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 4 | log4j.appender.stdout.target=system.out 5 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.stdout.layout.ConversionPattern=%d %p [%c{3}] | <%m>%n 7 | 8 | log4j.logger.com.gargoylesoftware.htmlunit=WARN -------------------------------------------------------------------------------- /scripts/src/test/resources/net/opengis/wps/v_1_0_0/GetCapabilities[0].xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 1.0.0 8 | 9 | 10 | -------------------------------------------------------------------------------- /scripts/src/test/resources/org/hisrc/jsonix/samples/po/test/po-0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Alice Smith 4 | 123 Maple Street 5 | Mill Valley 6 | CA 7 | 90952 8 | 9 | 10 | Robert Smith 11 | 8 Oak Avenue 12 | Old Town 13 | PA 14 | 95819 15 | 16 | Hurry, my lawn is going wild! 17 | 18 | 19 | 20 | 21 | Lawnmower 22 | 1 23 | 148.95 24 | Confirm this is electric 25 | 26 | 27 | 28 | Baby Monitor 29 | 1 30 | 39.98 31 | 1999-05-21 32 | 33 | 34 | -------------------------------------------------------------------------------- /scripts/src/test/resources/org/hisrc/jsonix/test/JsonixTest.xhtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 |
7 | 8 | -------------------------------------------------------------------------------- /scripts/src/test/resources/org/hisrc/jsonix/test/test0.xml: -------------------------------------------------------------------------------- 1 | 2 | goo 3 | -------------------------------------------------------------------------------- /scripts/test.bat: -------------------------------------------------------------------------------- 1 | java -jar JsTestDriver.jar --tests all -------------------------------------------------------------------------------- /setversion.bat: -------------------------------------------------------------------------------- 1 | setlocal 2 | echo Setting JAVA_HOME to %JAVA8_HOME%. 3 | set JAVA_HOME=%JAVA8_HOME% 4 | 5 | echo Setting new version to %1. 6 | rem pause 7 | call mvn versions:set -Pall,sonatype-oss-release -DnewVersion=%1 8 | echo Version was set to %1. 9 | rem pause 10 | call mvn versions:commit -Pall 11 | echo Version %1 committed. 12 | rem pause 13 | endlocal -------------------------------------------------------------------------------- /short-build.bat: -------------------------------------------------------------------------------- 1 | cd scripts 2 | call mvn clean install 3 | cd .. 4 | cd nodejs/scripts 5 | call mvn clean install 6 | cd ../.. -------------------------------------------------------------------------------- /src/main/bower/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jsonix", 3 | "version": "${project.version}", 4 | "homepage": "https://github.com/highsource/jsonix", 5 | "authors": [ 6 | "Alexey Valikov" 7 | ], 8 | "description": "Jsonix (JSON interfaces for XML) is a JavaScript library which allows converting between XML and JSON structures.", 9 | "main": "dist/Jsonix-all.js", 10 | "keywords" : [ "json", "xml", "unmarshal", "unmarshalling", "marshal", 11 | "marshalling", "parse", "parsing", "serialize", "serializing", 12 | "javascript objects", "dom", "util", "utility", "jaxb", "jsonix" ], 13 | "license": "BSD-3-Clause", 14 | "ignore": [ "**/.*", "tests", "README.md", "node_modules", "compiler", "demos", 15 | "docs", "fiddles", "formats", "full", "misc", "nodejs", "pom.xml", 16 | "release.bat", "samples", "scripts", "src" ] 17 | } 18 | -------------------------------------------------------------------------------- /typescript/README.md: -------------------------------------------------------------------------------- 1 | Because of the lack of a usable UML editor for Typescript I've used IntelliJ's Java-Uml. Typescript .d.ts are close to Java classes, so the diagram helps me to get the big picture. 2 | I investigated mainly the classes in org/hisrc/jsonix/Jsonix/Model to draw it. 3 | 4 | This typescript definitions are the first draft and the work is in progress. It's a base to discuss about. 5 | The aims of this branch are: 6 | 7 | Defining the public interfaces from the Context (marshaller, unmarshaller) 8 | Defining the internal data types (TypeInfo, PropertyInfo, Mapping) 9 | 10 | ... a fully migration to TS? 11 | 12 | I started with the data types because I need them for my current project 13 | 14 | There are still no tests, my suggestion is to use existing ones (and migrating later carefully to TS) but first we have to clear the working process. 15 | E.g. 16 | - Jsonix (sometimes) uses prototype (multiple) inheritance and there is a discussion how to handle this in TS 17 | - how to implement generics (witch would be very usefull) 18 | like createUnmarshaller(type: T): Unmarshaller (doesn't work without changing th jsonix code) 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /typescript/src/main/java/org/hisrc/jsonix/Binding/Mashalls/Element.java: -------------------------------------------------------------------------------- 1 | package org.hisrc.jsonix.Binding.Mashalls; 2 | 3 | public interface Element 4 | { 5 | Object elementInfo = null; 6 | String CLASS_NAME = ""; 7 | } 8 | -------------------------------------------------------------------------------- /typescript/src/main/java/org/hisrc/jsonix/Binding/Unmashalls/Element.java: -------------------------------------------------------------------------------- 1 | package org.hisrc.jsonix.Binding.Unmashalls; 2 | 3 | public interface Element 4 | { 5 | Object elementInfo = null; 6 | String CLASS_NAME = ""; 7 | } 8 | -------------------------------------------------------------------------------- /typescript/src/main/java/org/hisrc/jsonix/Mapping/Styled.java: -------------------------------------------------------------------------------- 1 | package org.hisrc.jsonix.Mapping; 2 | 3 | public interface Styled 4 | { 5 | Object mappingSyle = null; 6 | String CLASS_NAME = ""; 7 | } 8 | -------------------------------------------------------------------------------- /typescript/src/main/java/org/hisrc/jsonix/Model/AbstractElementRefsPropertyInfo.java: -------------------------------------------------------------------------------- 1 | package org.hisrc.jsonix.Model; 2 | 3 | 4 | public class AbstractElementRefsPropertyInfo extends PropertyInfo implements org.hisrc.jsonix.Binding.Mashalls.Element, org.hisrc.jsonix.Binding.Unmashalls.Element{ 5 | Object wrapperElementName = null; 6 | boolean allowDom = true; 7 | boolean allowTypedObject = true; 8 | boolean mixed = true; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /typescript/src/main/java/org/hisrc/jsonix/Model/AbstractElementsPropertyInfo.java: -------------------------------------------------------------------------------- 1 | package org.hisrc.jsonix.Model; 2 | 3 | import org.hisrc.jsonix.Schema.XML.QName; 4 | 5 | public class AbstractElementsPropertyInfo extends PropertyInfo implements org.hisrc.jsonix.Binding.Mashalls.Element, org.hisrc.jsonix.Binding.Unmashalls.Element{ 6 | QName wrapperElementName = null; 7 | boolean allowDom = false; 8 | boolean allowTypedObject = true; 9 | boolean mixed = false; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /typescript/src/main/java/org/hisrc/jsonix/Model/AnyAttributePropertyInfo.java: -------------------------------------------------------------------------------- 1 | package org.hisrc.jsonix.Model; 2 | 3 | public class AnyAttributePropertyInfo extends PropertyInfo { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /typescript/src/main/java/org/hisrc/jsonix/Model/AnyElementPropertyInfo.java: -------------------------------------------------------------------------------- 1 | package org.hisrc.jsonix.Model; 2 | 3 | /** 4 | * Created by tgrabietz on 15.04.16. 5 | */ 6 | public class AnyElementPropertyInfo extends PropertyInfo implements org.hisrc.jsonix.Binding.Mashalls.Element, org.hisrc.jsonix.Binding.Unmashalls.Element{ 7 | boolean allowDom = true; 8 | boolean allowTypedObject = true; 9 | boolean mixed = true; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /typescript/src/main/java/org/hisrc/jsonix/Model/AttributePropertyInfo.java: -------------------------------------------------------------------------------- 1 | package org.hisrc.jsonix.Model; 2 | 3 | public class AttributePropertyInfo extends SingleTypePropertyInfo { 4 | Object attributeName = null; 5 | 6 | } 7 | -------------------------------------------------------------------------------- /typescript/src/main/java/org/hisrc/jsonix/Model/ClassInfo.java: -------------------------------------------------------------------------------- 1 | package org.hisrc.jsonix.Model; 2 | 3 | import com.sun.org.apache.xml.internal.utils.Hashtree2Node; 4 | 5 | import org.hisrc.jsonix.Mapping.Styled; 6 | import org.hisrc.jsonix.Schema.XML.QName; 7 | 8 | import java.util.HashMap; 9 | import java.util.Properties; 10 | 11 | public class ClassInfo extends TypeInfo implements Styled { 12 | class Structure { 13 | HashMap elements = null; 14 | Object attributes = null; 15 | Object anyAttribute = null; 16 | Object value = null; 17 | Object any = null; 18 | } 19 | 20 | String name = null; 21 | String localName = null; 22 | QName typeName = null; 23 | Object instanceFactory = null; 24 | ElementPropertyInfo[] properties = null; 25 | HashMap propertiesMap = null; 26 | Structure structure = null; 27 | String targetNamespace = ""; 28 | String defaultElementNamespaceURI = ""; 29 | String defaultAttributeNamespaceURI = ""; 30 | boolean built = false; 31 | Object propertyInfoCreators = null; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /typescript/src/main/java/org/hisrc/jsonix/Model/ElementInfo.java: -------------------------------------------------------------------------------- 1 | package org.hisrc.jsonix.Model; 2 | 3 | public class ElementInfo { 4 | Object elementName = null; 5 | Object typeInfo = null; 6 | Object substitutionHead = null; 7 | Object scope = null; 8 | boolean built = false; 9 | } 10 | -------------------------------------------------------------------------------- /typescript/src/main/java/org/hisrc/jsonix/Model/ElementMapPropertyInfo.java: -------------------------------------------------------------------------------- 1 | package org.hisrc.jsonix.Model; 2 | 3 | public class ElementMapPropertyInfo extends AbstractElementsPropertyInfo { 4 | Object elementName = null; 5 | Object key = null; 6 | Object value = null; 7 | Object entryTypeInfo = null; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /typescript/src/main/java/org/hisrc/jsonix/Model/ElementPropertyInfo.java: -------------------------------------------------------------------------------- 1 | package org.hisrc.jsonix.Model; 2 | 3 | import org.hisrc.jsonix.Schema.XML.QName; 4 | 5 | public class ElementPropertyInfo extends AbstractElementsPropertyInfo implements org.hisrc.jsonix.Binding.Mashalls.Element{ 6 | //May be a String 7 | TypeInfo typeInfo = null; 8 | QName elementName = null; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /typescript/src/main/java/org/hisrc/jsonix/Model/ElementRefPropertyInfo.java: -------------------------------------------------------------------------------- 1 | package org.hisrc.jsonix.Model; 2 | 3 | public class ElementRefPropertyInfo extends AbstractElementRefsPropertyInfo { 4 | String typeInfo = "String"; 5 | Object elementName = null; 6 | 7 | } 8 | -------------------------------------------------------------------------------- /typescript/src/main/java/org/hisrc/jsonix/Model/ElementRefsPropertyInfo.java: -------------------------------------------------------------------------------- 1 | package org.hisrc.jsonix.Model; 2 | 3 | public class ElementRefsPropertyInfo extends AbstractElementRefsPropertyInfo { 4 | Object elementTypeInfos = null; 5 | Object elementTypeInfosMap = null; 6 | 7 | } 8 | -------------------------------------------------------------------------------- /typescript/src/main/java/org/hisrc/jsonix/Model/ElementsPropertyInfo.java: -------------------------------------------------------------------------------- 1 | package org.hisrc.jsonix.Model; 2 | 3 | public class ElementsPropertyInfo extends AbstractElementsPropertyInfo implements org.hisrc.jsonix.Binding.Mashalls.Element 4 | { 5 | Object elementTypeInfos = null; 6 | Object elementTypeInfosMap = null; 7 | 8 | } 9 | -------------------------------------------------------------------------------- /typescript/src/main/java/org/hisrc/jsonix/Model/EnumLeafInfo.java: -------------------------------------------------------------------------------- 1 | package org.hisrc.jsonix.Model; 2 | 3 | public class EnumLeafInfo extends TypeInfo { 4 | Object name = null; 5 | Object baseTypeInfo = "String"; 6 | Object entries = null; 7 | Object keys = null; 8 | Object values = null; 9 | boolean built = false; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /typescript/src/main/java/org/hisrc/jsonix/Model/Module.java: -------------------------------------------------------------------------------- 1 | package org.hisrc.jsonix.Model; 2 | 3 | import org.hisrc.jsonix.Mapping.Styled; 4 | 5 | public class Module implements Styled { 6 | Object name = null; 7 | Object typeInfos = null; 8 | Object elementInfos = null; 9 | String targetNamespace = ""; 10 | String defaultElementNamespaceURI = ""; 11 | String defaultAttributeNamespaceURI = ""; 12 | } 13 | -------------------------------------------------------------------------------- /typescript/src/main/java/org/hisrc/jsonix/Model/PropertyInfo.java: -------------------------------------------------------------------------------- 1 | package org.hisrc.jsonix.Model; 2 | 3 | public class PropertyInfo { 4 | String CLASS_NAME; 5 | Object name = null; 6 | boolean collection = false; 7 | String targetNamespace = ""; 8 | String defaultElementNamespaceURI = ""; 9 | String defaultAttributeNamespaceURI = ""; 10 | boolean built = false; 11 | } 12 | -------------------------------------------------------------------------------- /typescript/src/main/java/org/hisrc/jsonix/Model/SingleTypePropertyInfo.java: -------------------------------------------------------------------------------- 1 | package org.hisrc.jsonix.Model; 2 | 3 | public class SingleTypePropertyInfo extends PropertyInfo { 4 | String typeInfo = "String"; 5 | 6 | } 7 | -------------------------------------------------------------------------------- /typescript/src/main/java/org/hisrc/jsonix/Model/TypeInfo.java: -------------------------------------------------------------------------------- 1 | package org.hisrc.jsonix.Model; 2 | 3 | public class TypeInfo{ 4 | String CLASS_NAME; 5 | String name = ""; 6 | TypeInfo baseTypeInfo = null; 7 | } 8 | -------------------------------------------------------------------------------- /typescript/src/main/java/org/hisrc/jsonix/Model/ValuePropertyInfo.java: -------------------------------------------------------------------------------- 1 | package org.hisrc.jsonix.Model; 2 | 3 | public class ValuePropertyInfo extends SingleTypePropertyInfo { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /typescript/src/main/java/org/hisrc/jsonix/Schema/XML/QName.java: -------------------------------------------------------------------------------- 1 | package org.hisrc.jsonix.Schema.XML; 2 | 3 | public class QName 4 | { 5 | String key = null; 6 | String namespaceURI = null; 7 | String localPart = null; 8 | String prefix = null; 9 | String string = null; 10 | String CLASS_NAME = ""; 11 | 12 | } 13 | --------------------------------------------------------------------------------