Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. Validating XML against XSD in MSXML6.0

Validating XML against XSD in MSXML6.0

Scheduled Pinned Locked Moved XML / XSL
xmldatabasehelpquestionannouncement
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kavita seth
    wrote on last edited by
    #1

    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

    S 1 Reply Last reply
    0
    • K 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

      S Offline
      S Offline
      Stefan Troschuetz
      wrote on last edited by
      #2

      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

      www.troschuetz.de

      K 1 Reply Last reply
      0
      • S Stefan Troschuetz

        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

        www.troschuetz.de

        K Offline
        K Offline
        Kavita seth
        wrote on last edited by
        #3

        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

        S 1 Reply Last reply
        0
        • K 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

          S Offline
          S Offline
          Stefan Troschuetz
          wrote on last edited by
          #4

          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

          www.troschuetz.de

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups