Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re^2: .XSD (schema) Validation issue

by jeyroz (Monk)
on Feb 16, 2005 at 23:58 UTC ( #431790=note: print w/replies, xml ) Need Help??

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


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.


<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>


Any help is appreciated.


Replies are listed 'Best First'.
Re^3: .XSD (schema) Validation issue
by samtregar (Abbot) on Feb 17, 2005 at 00:09 UTC
    Yes, I made sure to read the documentation very closely but it didn't seem to shed any light on this particular error

    I wouldn't expect that it would. XML::Validator::Schema has terrible failure behavior. If it's trying to process a schema which is doing things it can't support it won't generally give you much help figuring out why.

    I hope the following .xsd snippet will be helpful

    Not particularly... I don't see any place in that snippet where a simpleType is the (direct) child of a complexType. Are you sure you've found the problem?

    Here's what I need if I'm going to find and fix this bug:

    • A small, complete XSD file containing the problematic construct. No more than 20 lines would be ideal.
    • A small XML file which you posit should validate against the sample XSD. Again, smaller is better.

    In some cases I can create these myself but you haven't given me enough information to do the job.



      I would be happy to help but I'm quite new to the XML/XSD front. Tearing that xsd file down to a manageable size without understanding the intricacies would most likely prove useless. I would be happy to send you the .xsd and sample .xml file that I have been working with. They are large but they validate in XMLSpy and are the ones causing trouble with your mod.

      Let me know.

        Well, alright, but just this once. Send them to me at


Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://431790]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2023-05-29 15:54 GMT
Find Nodes?
    Voting Booth?

    No recent polls found