Hi there,
Moxy generated wrong output when there is XML mixed element type and one of the nested elements is a string type.
Then in generated json, text is put into nested element instead of "value" element.
Example:
Schema:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" >
<xs:element name="root" type="rootType"/>
<xs:complexType name="rootType">
<xs:sequence>
<xs:element type="elementType" name="element" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="elementType" mixed="true">
<xs:sequence>
<xs:element type="xs:string" name="nested" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
sample xml:
<root>
<element>should be into value element, not in nested<nested>nested content</nested></element>
</root>
Gives unexpected json output:
{"root":{"element":[{"nested":["should be into value element, not in nested","nested content"]}]}}
[Updated on: Fri, 07 August 2015 08:12]
Report message to a moderator