databricks / spark-xml

XML data source for Spark SQL and DataFrames
Apache License 2.0
500 stars 226 forks source link

Allow for top-level simple type declarations in XSD, referenced by name, when parsing XSD as schema #635

Closed srowen closed 1 year ago

srowen commented 1 year ago

Just recording a todo for myself. If a type is declared in an XSD and then used by name, it should work:

  <xs:simpleType name="somedecimal">
    <xs:restriction base="xs:decimal">
      <xs:fractionDigits value="6"/>
      <xs:totalDigits value="12"/>
    </xs:restriction>
  </xs:simpleType>
 ...
   <xs:element name="decimal_thing" type="somedecimal"/>

(incidentally, need to support totalDigits too)

srowen commented 1 year ago

Resolved by https://github.com/databricks/spark-xml/pull/638