http://www.perlmonks.org?node_id=431790


in reply to Re: .XSD (schema) Validation issue
in thread .XSD (schema) Validation issue

Sam,

Thanks for posting!
Yes, I made sure to read the documentation very closely but it didn't seem to shed any light on this particular error - other than "SimpleTypes must come after their base types in the schema body."

I searched through the module source and found where the error was being generated:

_err("Found <simpleType> illegally combined with complexType>.") if $mother->{is_complex};

By "illegally combined" does the error mean simpleType cannot be a child (or parent) of complexType?

I hope the following .xsd snippet will be helpful as it seem s exemplary of the file as a whole.

SAMPLE XSD MARKUP

<xsd:element name="Phone" type="PhoneType" minOccurs="0"/> <xsd:element name="Fax" minOccurs="0"> <xsd:complexType> <xsd:sequence> <xsd:element name="F_AreaCode" nillable="1"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:length value="3"/> </xsd:restriction> </xsd:simpleType> </xsd:element> <xsd:element name="F_Prefix" nillable="1"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:length value="3"/> </xsd:restriction> </xsd:simpleType> </xsd:element> <xsd:element name="F_Suffix" nillable="1"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:length value="4"/> </xsd:restriction> </xsd:simpleType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element>

END SAMPLE XSD

Any help is appreciated.

j