Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Blocker
-
Resolution: Unresolved
-
Affects Version/s: 1.0.4
-
Fix Version/s: None
-
Component/s: XML
-
Labels:None
-
Environment:Windows Xp
-
Number of attachments :
Description
I am generating schema from xml instance using the XMLInstance2Schema API.
Schema st_schema =
new XMLInstance2Schema().createSchema(l_reader_xmlInstance);
The input XML instance is
<CONTACT>
<NAME index="1">a</NAME>
<FAX index="1">a</FAX>
<NAME index="1">a</NAME>
<TELEPHONE index="1">a</TELEPHONE>
</CONTACT>
Generated schema is:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="CONTACT">
<xsd:complexType>
<xsd:all>
<xsd:element name="NAME" maxOccurs="unbounded">
<xsd:complexType mixed="true">
<xsd:sequence/>
<xsd:attribute name="index" type="xsd:integer"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="FAX">
<xsd:complexType mixed="true">
<xsd:sequence/>
<xsd:attribute name="index" type="xsd:integer"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="TELEPHONE">
<xsd:complexType mixed="true">
<xsd:sequence/>
<xsd:attribute name="index" type="xsd:integer"/>
</xsd:complexType>
</xsd:element>
</xsd:all>
</xsd:complexType>
</xsd:element>
</xsd:schema>
The generated schema contains <xsd:all> with <xsd:element name="NAME" maxOccurs="unbounded">.
where as maxOccurs in <xsd:all> element does not allow unbounded as the value. maxOccurs in xsd:all element allows either 0 or 1 only.
So schema validation is failing in my application.
Please do favour ASAP and thanks in advance.
Issue Links
- is duplicated by
-
CASTOR-1674
invalid xsd schema generated from the instance
-