Open glassfishrobot opened 7 years ago
The issue is described here. In particular for the following model element:
@XmlRootElement(name = "any-text") public class AnyText { @XmlElementWrapper(name = "fixed-text", required = true) @XmlElementRefs({ @XmlElementRef(name = "year", namespace = "http://foo.org/", type = JAXBElement.class, required = false), @XmlElementRef(name = "title", namespace = "http://foo.org/", type = JAXBElement.class, required = false) }) @XmlMixed protected List<Serializable> fixedText = new ArrayList<Serializable>(); ...
the hanging text nodes are not unmarshalled/marshalled. Sample XML:
<any-text xmlns="http://foo.org/"> <fixed-text>The story <title>Alice in Wonderland</title> was printed in <year>1865</year>.</fixed-text> </any-text>
Sample XSD:
<xs:schema jaxb:version="2.0" targetNamespace="http://foo.org/" xmlns:foo="http://foo.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" > <xs:complexType name="fixed-text" mixed="true"> <xs:choice maxOccurs="unbounded"> <xs:element name="title" type="xs:string" /> <xs:element name="year" type="xs:int" /> </xs:choice> </xs:complexType> <xs:element name="any-text"> <xs:complexType> <xs:sequence> <xs:element name="fixed-text" type="foo:fixed-text" /> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
[2.2.8 (JDK 8)]
Reported by dma_k
Was assigned to yaroska
This issue was imported from java.net JIRA JAXB-1107
The issue is described here. In particular for the following model element:
the hanging text nodes are not unmarshalled/marshalled. Sample XML:
Sample XSD:
Affected Versions
[2.2.8 (JDK 8)]