Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: .XSD (schema) Validation issue

by samtregar (Abbot)
on Feb 16, 2005 at 21:17 UTC ( #431758=note: print w/replies, xml ) Need Help??


in reply to .XSD (schema) Validation issue

Have you read the documentation? In particular pay attention to the schema support section. It's likely that you're trying to do something that isn't supported yet by XML::Validator::Schema.

If you've read the docs and you're reasonably sure that you're painting within the lines then please post the XSD file. If it's huge try to find a smallish snippet that reproduces the problem.

-sam

Replies are listed 'Best First'.
Re^2: .XSD (schema) Validation issue
by jeyroz (Monk) on Feb 16, 2005 at 23:58 UTC

    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

      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.

      Thanks,
      -sam

        Sam,

        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.

        j

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2023-09-29 00:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?