Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » [Moxy] json marshalling, mixed element unexpected behaviour
[Moxy] json marshalling, mixed element unexpected behaviour [message #1704072] Fri, 07 August 2015 07:50
Paweł Englert is currently offline Paweł EnglertFriend
Messages: 8
Registered: November 2014
Junior Member
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

Previous Topic:Entities OneToMany Composite Primary keys
Next Topic:[Moxy] setValidating is throwing an exception when used on DynamicContext
Goto Forum:
  


Current Time: Thu Mar 28 17:16:59 GMT 2024

Powered by FUDForum. Page generated in 0.06090 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top