You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Syed Atif Akhtar (Jira)" <ji...@apache.org> on 2025/08/03 15:58:00 UTC
[jira] [Created] (SPARK-53085) Extend XSDToSchema to parse XML Attribute Group ref types
Syed Atif Akhtar created SPARK-53085:
----------------------------------------
Summary: Extend XSDToSchema to parse XML Attribute Group ref types
Key: SPARK-53085
URL: https://issues.apache.org/jira/browse/SPARK-53085
Project: Spark
Issue Type: Improvement
Components: SQL
Affects Versions: 4.0.0
Reporter: Syed Atif Akhtar
The XSDToSchema parser currently fails when parsing XSD with reusable attribute group references like below
{code:java}
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:attributeGroup name="AttributeGroup1">
<xs:attribute name="attr1" type="xs:string" />
<xs:attribute name="attr2" type="xs:integer" />
</xs:attributeGroup>
<xs:element name="RootElement">
<xs:complexType>
<xs:attributeGroup ref="AttributeGroup1" />
</xs:complexType>
</xs:element>
<!-- Step 3: Another Element Using the Same Attribute Group -->
<xs:element name="AnotherElement">
<xs:complexType>
<xs:attributeGroup ref="AttributeGroup1" />
</xs:complexType>
</xs:element>
</xs:schema>{code}
And fails with the below scala.Match error:
{noformat}
org.apache.ws.commons.schema.XmlSchemaAttributeGroupRef@230a73f2 (of class org.apache.ws.commons.schema.XmlSchemaAttributeGroupRef)
scala.MatchError: org.apache.ws.commons.schema.XmlSchemaAttributeGroupRef@230a73f2 (of class org.apache.ws.commons.schema.XmlSchemaAttributeGroupRef){noformat}
Suggestion: Extend the XSD parser to further continue parsing attributes when a type of XmlSchemaAttributeGroupRef is encountered.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org