0

I am trying to use the sbt-scalaxb to generate bindings for the FixRepository.xsd and it does not like the SUBJ.

As a last resort, of cause, I can to slightly change the schema, but is there maybe a way to tune the sbt-scalaxb to understand the original file?

The XSD fragment the sbt-scalaxb does not like is:

xml <xs:element name="component"> <xs:complexType> <xs:sequence> <xs:element ref="messageEntity" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attributeGroup ref="entityAttribGrp"/> <xs:attribute name="id" type="id_t" use="required"/> <xs:attribute name="name" type="xs:string" use="required"/> <xs:attribute name="type" type="ComponentType_t" use="required"/> <xs:attribute name="repeating" type="BOOL_t" use="optional"/> <xs:attribute name="category" type="xs:string" use="optional"/> <xs:attribute name="abbrName" type="xs:string" use="optional"/> <xs:attribute name="notReqXML" type="BOOL_t" use="optional"/> <!-- would like to force a description of the component --> </xs:complexType> </xs:element>

bobah
  • 16,722
  • 1
  • 31
  • 57

1 Answers1

0

Figured out myself: scalaxbAttributePrefix setting adds a prefix to the attribute properties.

build.sbt

scalaxbAttributePrefix in (Compile, scalaxb) := Some("attr")

Generated FixRepository.scala

case class Fix(
    ...,
    components: ...fixrepo.Components,
    ...,
    attributes: Map[String, scalaxb.DataRecord[Any]] = Map()
) {
    ...
    lazy val attrComponents = attributes("@components").as[BOOL_t]
    ...
}
bobah
  • 16,722
  • 1
  • 31
  • 57