Skip to content

Commit 9afbb87

Browse files
committed
Merge pull request #97 from amarant/GH96
Repro case for #96
2 parents c974573 + 0794ca6 commit 9afbb87

File tree

5 files changed

+111
-1
lines changed

5 files changed

+111
-1
lines changed

nodejs/scripts/tests/GH96/GH96.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
};
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
var test_any_Module_Factory = function () {
2+
var test_any = {
3+
name: 'test_any',
4+
typeInfos: [{
5+
localName: 'MixedAnyType',
6+
typeName: {
7+
namespaceURI: 'test:any',
8+
localPart: 'MixedAnyType'
9+
},
10+
propertyInfos: [{
11+
name: 'content',
12+
collection: true,
13+
type: 'anyElement'
14+
}]
15+
}, {
16+
localName: 'INCLUDED',
17+
typeName: {
18+
namespaceURI: 'test:any',
19+
localPart: 'INCLUDED'
20+
},
21+
propertyInfos: [{
22+
name: 'majorVersion',
23+
typeInfo: 'Integer',
24+
attributeName: {
25+
localPart: 'majorVersion'
26+
},
27+
type: 'attribute'
28+
}]
29+
}, {
30+
localName: 'TESTANY',
31+
typeName: null,
32+
propertyInfos: [{
33+
name: 'en',
34+
elementName: {
35+
localPart: 'en'
36+
},
37+
typeInfo: '.MixedAnyType'
38+
}]
39+
}],
40+
elementInfos: [{
41+
elementName: {
42+
localPart: 'TESTANY',
43+
namespaceURI: 'test:any'
44+
},
45+
typeInfo: '.TESTANY'
46+
}]
47+
};
48+
return {
49+
test_any: test_any
50+
};
51+
};
52+
if (typeof define === 'function' && define.amd) {
53+
define([], test_any_Module_Factory);
54+
}
55+
else {
56+
var test_any_Module = test_any_Module_Factory();
57+
if (typeof module !== 'undefined' && module.exports) {
58+
module.exports.test_any = test_any_Module.test_any;
59+
}
60+
else {
61+
var test_any = test_any_Module.test_any;
62+
}
63+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<testany:TESTANY xmlns:testany="test:any" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="test:any test_any.xsd">
3+
<en>
4+
<INCLUDED xsi:type="testany:INCLUDED" majorVersion="1"/>
5+
</en>
6+
</testany:TESTANY>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8" standalone="no"?>
2+
<xs:schema targetNamespace="test:any" xmlns:testany="test:any" xml:lang="fr" elementFormDefault="unqualified" attributeFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
3+
<xs:complexType name="MixedAnyType" mixed="true">
4+
<xs:choice minOccurs="0" maxOccurs="unbounded">
5+
<xs:any namespace="##any" processContents="lax"/>
6+
</xs:choice>
7+
</xs:complexType>
8+
<xs:complexType name="INCLUDED">
9+
<xs:attribute name="majorVersion" type="xs:nonNegativeInteger" use="required">
10+
</xs:attribute>
11+
</xs:complexType>
12+
<xs:element name="TESTANY">
13+
<xs:complexType>
14+
<xs:sequence>
15+
<xs:element name="en" type="testany:MixedAnyType">
16+
</xs:element>
17+
</xs:sequence>
18+
</xs:complexType>
19+
</xs:element>
20+
</xs:schema>

nodejs/scripts/tests/issues.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module.exports = {
66
"GH70" : require('./GH70/GH70'),
77
"GH71" : require('./GH71/GH71'),
88
"GH73" : require('./GH73/GH73'),
9-
"GH83" : require('./GH83/GH83')
9+
"GH83" : require('./GH83/GH83'),
10+
"GH96" : require('./GH96/GH96')
1011
}
1112
};

0 commit comments

Comments
 (0)