navigating XML Schema

This is a memo to navigate around the case classes for XML Schema. Besides the derivation by extension that programming languages have as inheritance, XML Schema also allows derivation by restriction. Since Scala I don't think expresses this easily, some types are wider than how they are specified in the schema.

XElement

  • known subclasses: XTopLevelElement, XLocalElementable, XNarrowMaxMin, XLocalElement
  • value member: xelementoption : Option[DataRecord[XElementOption]]
  • value member: name: Option[String]
  • value member: ref : Option[QName]
  • value member: typeValue : Option[QName]

XSimpleType

  • known subclasses: XTopLevelSimpleType, XLocalSimpleType
  • value member: arg1 : DataRecord[XSimpleDerivationOption]
  • XUnion

    • value member: memberTypes : Option[Seq[QName]]
  • XRestriction

    • value member: arg1 : XSimpleRestrictionModelSequence
    • XSimpleRestrictionModelSequence
      • value member: arg2 : Seq[DataRecord[XFacetsOption]]
        • known subclasses: XFacetable, XWhiteSpace, XNumFacetable, XTotalDigits, XNoFixedFacetable, XPattern, XNumFacet, XNoFixedFacet, XFacet. At runtime, XNoFixedFacetable will be parsed as XNoFixedFacet.
    def parseXFacetsGroup: Parser[scalaxb.DataRecord[xmlschema.XFacetsOption]] =
      (((scalaxb.ElemName(targetNamespace, "minExclusive")) ^^ 
      (x => scalaxb.DataRecord(x.namespace, Some(x.name), fromXML[xmlschema.XFacetable](x)))) | 
      ((scalaxb.ElemName(targetNamespace, "minInclusive")) ^^ 
      (x => scalaxb.DataRecord(x.namespace, Some(x.name), fromXML[xmlschema.XFacetable](x)))) | 
      ((scalaxb.ElemName(targetNamespace, "maxExclusive")) ^^ 
      (x => scalaxb.DataRecord(x.namespace, Some(x.name), fromXML[xmlschema.XFacetable](x)))) | 
      ((scalaxb.ElemName(targetNamespace, "maxInclusive")) ^^ 
      (x => scalaxb.DataRecord(x.namespace, Some(x.name), fromXML[xmlschema.XFacetable](x)))) | 
      ((scalaxb.ElemName(targetNamespace, "totalDigits")) ^^ 
      (x => scalaxb.DataRecord(x.namespace, Some(x.name), fromXML[xmlschema.XTotalDigits](x)))) | 
      ((scalaxb.ElemName(targetNamespace, "fractionDigits")) ^^ 
      (x => scalaxb.DataRecord(x.namespace, Some(x.name), fromXML[xmlschema.XNumFacetable](x)))) | 
      ((scalaxb.ElemName(targetNamespace, "length")) ^^ 
      (x => scalaxb.DataRecord(x.namespace, Some(x.name), fromXML[xmlschema.XNumFacetable](x)))) | 
      ((scalaxb.ElemName(targetNamespace, "minLength")) ^^ 
      (x => scalaxb.DataRecord(x.namespace, Some(x.name), fromXML[xmlschema.XNumFacetable](x)))) | 
      ((scalaxb.ElemName(targetNamespace, "maxLength")) ^^ 
      (x => scalaxb.DataRecord(x.namespace, Some(x.name), fromXML[xmlschema.XNumFacetable](x)))) | 
      ((scalaxb.ElemName(targetNamespace, "enumeration")) ^^ 
      (x => scalaxb.DataRecord(x.namespace, Some(x.name), fromXML[xmlschema.XNoFixedFacetable](x)))) | 
      ((scalaxb.ElemName(targetNamespace, "whiteSpace")) ^^ 
      (x => scalaxb.DataRecord(x.namespace, Some(x.name), fromXML[xmlschema.XWhiteSpace](x)))) | 
      ((scalaxb.ElemName(targetNamespace, "pattern")) ^^ 
      (x => scalaxb.DataRecord(x.namespace, Some(x.name), fromXML[xmlschema.XPattern](x)))))

XComplexType

XSimpleContent

  • value member: xsimplecontentoption : DataRecord[XSimpleContentOption]
  • XSimpleRestrictionType

    • super type: XRestrictionTypable
    • value member: xrestrictiontypableoption : Option[DataRecord[Any]]. At runtime, this contains Option[DataRecord[XSimpleRestrictionModelSequence]].
    • XSimpleRestrictionModelSequence
      • value member: arg2 : Seq[DataRecord[XFacetsOption]]
    • value member: arg2 : XAttrDeclsSequence
    • value member: base : QName
  • XSimpleExtensionType

    • super type: XExtensionTypable
    • value member: arg2 : XAttrDeclsSequence
    • value member: base : QName

XComplexContent

XComplexTypeModelSequence1

This is an abbreviated form of complex content restriction of xs:anyType.

XTypeDefParticleOption

    def parseXTypeDefParticleGroup(wrap: Boolean): Parser[scalaxb.DataRecord[xmlschema.XTypeDefParticleOption]] =
      (((scalaxb.ElemName(targetNamespace, "group")) ^^ 
      (x => scalaxb.DataRecord(x.namespace, Some(x.name), fromXML[xmlschema.XGroupRef](x)))) | 
      ((scalaxb.ElemName(targetNamespace, "all")) ^^ 
      (x => scalaxb.DataRecord(x.namespace, Some(x.name), fromXML[xmlschema.XAllable](x)))) | 
      ((scalaxb.ElemName(targetNamespace, "choice")) ^^ 
      (x => scalaxb.DataRecord(x.namespace, Some(x.name), fromXML[xmlschema.XExplicitGroupable](x)))) | 
      ((scalaxb.ElemName(targetNamespace, "sequence")) ^^ 
      (x => scalaxb.DataRecord(x.namespace, Some(x.name), fromXML[xmlschema.XExplicitGroupable](x)))))
  • XGroupRef

  • super type: XRealGroupable, which extends XGroup

  • value member: arg1 : Seq[DataRecord[XParticleOption]]. At runtime, this will be Nil.
  • value member: name : Option[String]. At runtime, this will be None.
  • value member: ref : Option[QName]. At runtime, this will be Some(qname).
  • value member: maxOccurs : String
  • value member: minOccurs : Int

  • XExplicitGroupable

    Likely at the runtime, this is parsed as XExplicitGroup.

  • super type: XGroup

  • value member: arg1 : Seq[DataRecord[XParticleOption]].
    def parseXParticleGroup(wrap: Boolean): Parser[scalaxb.DataRecord[xmlschema.XParticleOption]] =
      (((scalaxb.ElemName(targetNamespace, "element")) ^^ 
      (x => scalaxb.DataRecord(x.namespace, Some(x.name), fromXML[xmlschema.XLocalElementable](x)))) | 
      ((scalaxb.ElemName(targetNamespace, "group")) ^^ 
      (x => scalaxb.DataRecord(x.namespace, Some(x.name), fromXML[xmlschema.XGroupRef](x)))) | 
      ((scalaxb.ElemName(targetNamespace, "all")) ^^ 
      (x => scalaxb.DataRecord(x.namespace, Some(x.name), fromXML[xmlschema.XAllable](x)))) | 
      ((scalaxb.ElemName(targetNamespace, "choice")) ^^ 
      (x => scalaxb.DataRecord(x.namespace, Some(x.name), fromXML[xmlschema.XExplicitGroupable](x)))) | 
      ((scalaxb.ElemName(targetNamespace, "sequence")) ^^ 
      (x => scalaxb.DataRecord(x.namespace, Some(x.name), fromXML[xmlschema.XExplicitGroupable](x)))) | 
      ((scalaxb.ElemName(targetNamespace, "any")) ^^ 
      (x => scalaxb.DataRecord(x.namespace, Some(x.name), fromXML[xmlschema.XAny](x)))))
  • value member: name : Option[String]. At runtime, this will be None.
  • value member: ref : Option[QName]. At runtime, this will be None.
  • value member: maxOccurs : String
  • value member: minOccurs : Int

  • XAllable

    Likely at the runtime, this is parsed as XAllType.

  • super type: XExplicitGroupable

  • value member: arg1 : Seq[DataRecord[XParticleOption]]. At runtime, this will only contain XLocalElementable.
  • value member: name : Option[String]. At runtime, this will be None.
  • value member: ref : Option[QName]. At runtime, this will be None.
  • value member: maxOccurs : String
  • value member: minOccurs : Int