Hi Everyone !
I am a beginner in XML, I want to know how to define the Actions element of the XML document by creating a complex XSD custom type that can check the Actions element ?
Can you help to validate my both xml with my XSD Schema
Paul Clapham wrote:Okay... what makes you think it didn't validate both XMLs?
Because I had an error on the reject element.
I managed to validate my two xml. My second problem is that I want to
define the Actions element of the XML document by creating a complex custom XSD type that can check the Actions element. For example using <xs:complexType name="ActionsType" > I don't know how to set it up
Thank in advance
Why are you using "ref" everywhere? Instead of wrapping all your complex types in <xs:element>, declare your complex types directly in <xs:schema> and then use the "type" attribute rather than the "ref" attribute to type your child nodes.
You should have only one <xs:element> element directly in your <xs:schema>, which is the root element for your PurchaseOrder:
Change your XSD, post it here and tell us what problem you are facing afterwards.
Stephan van Hulst wrote:Why yes, you have an empty <Reject/> element in your XML, which doesn't conform to your new schema.
Why have you declared RejectOne and RejectTwo if you're not using them?
It is normal that my xml has an empty reject. I have to validate two xml where one has an "empty reject" and the other one doesn't. I edited my XSD actually I was not using "rejectOne and rejectTwo". I can't get them to validate .