You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?xml version="1.0" encoding="UTF-8"?>
<xs:schemaxmlns:xs="http://www.w3.org/2001/XMLSchema"targetNamespace="http://sipria.eu/scalaxb-bug/"elementFormDefault="qualified"attributeFormDefault="unqualified">
<xs:elementname="ApplicationResponse">
<xs:annotation>
<xs:documentation>Wrapper for data. Used for transmitting data</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:elementname="Extension"type="xs:anyType"minOccurs="0"/>
<xs:elementname="FileType"minOccurs="0"/>
<xs:elementname="Content"type="xs:base64Binary"nillable="false"minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
using this sbt options:
sourceGenerators in Compile<+= scalaxb in Compile,
dispatchVersion in scalaxb in Compile:="0.11.3",
packageNames in scalaxb in Compile:=Map(
uri("http://sipria.eu/scalaxb-bug/") ->"bug"
)
When parsing xml that does not have first optionals, then first elements are filled with content indented for later elements
scala> scalaxb.fromXML[bug.ApplicationResponse](<ApplicationResponsexmlns="http://sipria.eu/scalaxb-bug/"><Content>UGlwcHVyaSAmIEthbmVsaQ==</Content></ApplicationResponse>)
res0: bug.ApplicationResponse=ApplicationResponse(Some(DataRecord({http://sipria.eu/scalaxb-bug/}Content,<Contentxmlns="http://sipria.eu/scalaxb-bug/">UGlwcHVyaSAmIEthbmVsaQ==</Content>)),None,None)
// Content is rightly parsed only when all other optional elements exists
scala> scalaxb.fromXML[bug.ApplicationResponse](<ApplicationResponsexmlns="http://sipria.eu/scalaxb-bug/"><Extension></Extension><FileType></FileType><Content>UGlwcHVyaSAmIEthbmVsaQ==</Content></ApplicationResponse>)
res1: bug.ApplicationResponse=ApplicationResponse(Some(DataRecord({http://sipria.eu/scalaxb-bug/}Extension,<Extensionxmlns="http://sipria.eu/scalaxb-bug/"></Extension>)),Some(DataRecord({http://sipria.eu/scalaxb-bug/}FileType,<FileTypexmlns="http://sipria.eu/scalaxb-bug/"></FileType>)),Some(UGlwcHVyaSAmIEthbmVsaQ==))
Critical bug with
scalaxb.fromXML
I made little example xsd:
using this sbt options:
Generated code is "correct":
When parsing xml that does not have first optionals, then first elements are filled with content indented for later elements
Generated
Format
code as following:The text was updated successfully, but these errors were encountered: