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. Validation of attributes in combination of other attributes?

Validation of attributes in combination of other attributes?

Scheduled Pinned Locked Moved XML / XSL
xmlquestion
3 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.
  • M Offline
    M Offline
    mav northwind
    wrote on last edited by
    #1

    Hi! Perhaps someone can give me a push in the right direction? I've got an XML file I want to validate using an XMLSchema. One of the elements has an attribute that can be optional if another attribute has a certain value and that is required in other cases. Is there a way to include such conditions into an XSD or do I have to validate this condition manually?

    Regards, mav -- Black holes are the places where God divided by 0...

    E 1 Reply Last reply
    0
    • M mav northwind

      Hi! Perhaps someone can give me a push in the right direction? I've got an XML file I want to validate using an XMLSchema. One of the elements has an attribute that can be optional if another attribute has a certain value and that is required in other cases. Is there a way to include such conditions into an XSD or do I have to validate this condition manually?

      Regards, mav -- Black holes are the places where God divided by 0...

      E Offline
      E Offline
      Erik Westermann
      wrote on last edited by
      #2

      Interesting question. You are asking about something called a co-occurrence constraint. XML Schema does not directly support co-occurrence constraints, but it is an area some people are researching. A researcher, Fabio Vitali, has done some work in this area and has come up with a solution that pre-processes a special file that results in a new XML schema. The new XML schema is then used to validate instance documents. Here's the link http://tesi.fabio.web.cs.unibo.it/Tesi/SchemaPath[^] - click the link "SchemaPathImplementations" for the stylesheets and other files you'll need. A much simpler approach is to validate this manually, but Fabio Vitali offers a way using XSL and XML Schema - which is pretty cool!

      Erik Westermann - wWorkflow.net - BizTalk Consulting Services
      SOA * ESB * BPI * SaaS ... forget the alphabet soup - get the main course with our consulting services!
      wWorkflow.net or +1 416-809-1453

      M 1 Reply Last reply
      0
      • E Erik Westermann

        Interesting question. You are asking about something called a co-occurrence constraint. XML Schema does not directly support co-occurrence constraints, but it is an area some people are researching. A researcher, Fabio Vitali, has done some work in this area and has come up with a solution that pre-processes a special file that results in a new XML schema. The new XML schema is then used to validate instance documents. Here's the link http://tesi.fabio.web.cs.unibo.it/Tesi/SchemaPath[^] - click the link "SchemaPathImplementations" for the stylesheets and other files you'll need. A much simpler approach is to validate this manually, but Fabio Vitali offers a way using XSL and XML Schema - which is pretty cool!

        Erik Westermann - wWorkflow.net - BizTalk Consulting Services
        SOA * ESB * BPI * SaaS ... forget the alphabet soup - get the main course with our consulting services!
        wWorkflow.net or +1 416-809-1453

        M Offline
        M Offline
        mav northwind
        wrote on last edited by
        #3

        Great, thanks for the reply! I'll take a look at the link.

        Regards, mav -- Black holes are the places where God divided by 0...

        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