Validating XML against XSD in MSXML6.0
-
Hi All, I am facing some problem in validating my xml file against the xsd. I have used "Complexcontent" to define the type of an attribute in my XML. Incase of MSXML4.0 it is getting validated against the attached code of xsd but the same thing is failing in case of MSXML6.0. Schema: < ?xml version="1.0" encoding="UTF-8" standalone="no"?> < xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> ... ... ... < xsd:complexType name="OEM"> < xsd:complexContent> < xsd:extension base="INFO-COMPONENT"/> < /xsd:complexContent> < /xsd:complexType> ... ... < xsd:complexType name="INFO-COMPONENT"> < xsd:attribute use="required" type="xsd:ID" name="ID"/> < xsd:attribute use="optional" type="xsd:string" name="OID"/> < /xsd:complexType> ... ... ... < /xsd:schema> XML: < ?xml version="1.0" encoding="UTF-8" ?> < ODX MODEL-VERSION="2.0.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="odx.xsd"> ... ... < PARENT-REFS> < INFO-COMPONENT DOCREF="PR_UDS" DOCTYPE="LAYER" ID-REF="PR_UDS" xsi:type="OEM" /> < /PARENT-REFS> ... ... < /ODX> Is any body having some solution to this?reply at the earliest its very urgent.:( Thanks in advance... Note: I have intentionally added a space after each "<" to make the code visible in this editor
Kavita seth
-
Hi All, I am facing some problem in validating my xml file against the xsd. I have used "Complexcontent" to define the type of an attribute in my XML. Incase of MSXML4.0 it is getting validated against the attached code of xsd but the same thing is failing in case of MSXML6.0. Schema: < ?xml version="1.0" encoding="UTF-8" standalone="no"?> < xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> ... ... ... < xsd:complexType name="OEM"> < xsd:complexContent> < xsd:extension base="INFO-COMPONENT"/> < /xsd:complexContent> < /xsd:complexType> ... ... < xsd:complexType name="INFO-COMPONENT"> < xsd:attribute use="required" type="xsd:ID" name="ID"/> < xsd:attribute use="optional" type="xsd:string" name="OID"/> < /xsd:complexType> ... ... ... < /xsd:schema> XML: < ?xml version="1.0" encoding="UTF-8" ?> < ODX MODEL-VERSION="2.0.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="odx.xsd"> ... ... < PARENT-REFS> < INFO-COMPONENT DOCREF="PR_UDS" DOCTYPE="LAYER" ID-REF="PR_UDS" xsi:type="OEM" /> < /PARENT-REFS> ... ... < /ODX> Is any body having some solution to this?reply at the earliest its very urgent.:( Thanks in advance... Note: I have intentionally added a space after each "<" to make the code visible in this editor
Kavita seth
Kavita seth wrote:
the same thing is failing in case of MSXML6.0
What exactly does that mean? Do you get any error message?
Kavita seth wrote:
Note: I have intentionally added a space after each "<" to make the code visible in this editor
To ease things for future posts: Simply check the "Ignore HTML tags in this message" checkbox beneath the smilies.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
-
Kavita seth wrote:
the same thing is failing in case of MSXML6.0
What exactly does that mean? Do you get any error message?
Kavita seth wrote:
Note: I have intentionally added a space after each "<" to make the code visible in this editor
To ease things for future posts: Simply check the "Ignore HTML tags in this message" checkbox beneath the smilies.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
Hi Stefan,
Stefan Troschuetz wrote:
Do you get any error message?
I am getting the reason of failure as: "Type 'OEM' is not found in Schema" Can you please suggest some solution for this? Thanks in advance. And also Thanks for your suggestion on my note.
Kavita seth
-
Hi Stefan,
Stefan Troschuetz wrote:
Do you get any error message?
I am getting the reason of failure as: "Type 'OEM' is not found in Schema" Can you please suggest some solution for this? Thanks in advance. And also Thanks for your suggestion on my note.
Kavita seth
Kavita seth wrote:
Can you please suggest some solution for this?
Mmh, I'm not sure where this error comes from as the OEM type is declared in the schema. Maybe it has something to do with declaring all schema components in the empty namespace. I strongly recommend using a custom target namespace. Also it might be helpful to see the declaration of the INFO-COMPONENT element.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook