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. Xml Schema question

Xml Schema question

Scheduled Pinned Locked Moved XML / XSL
xmlquestiondatabasecomsysadmin
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.
  • J Offline
    J Offline
    Jamie Nordmeyer
    wrote on last edited by
    #1

    When defining an XML Schema, is it possible to specify that an attribute is required when another is set to a certain value? For example, if the type attribute of my server element is set to DMZ, then the username and password attributes of the deploy element must be set as well. Is this possible, or do I just have to enforce it in the code library that consumes the xml file? Thanks.

    Kyosa Jamie Nordmeyer - Taekwondo Yi (2nd) Dan Portland, Oregon, USA
    www.defaultn.com

    G 1 Reply Last reply
    0
    • J Jamie Nordmeyer

      When defining an XML Schema, is it possible to specify that an attribute is required when another is set to a certain value? For example, if the type attribute of my server element is set to DMZ, then the username and password attributes of the deploy element must be set as well. Is this possible, or do I just have to enforce it in the code library that consumes the xml file? Thanks.

      Kyosa Jamie Nordmeyer - Taekwondo Yi (2nd) Dan Portland, Oregon, USA
      www.defaultn.com

      G Offline
      G Offline
      George L Jackson
      wrote on last edited by
      #2

      Sorry, that is not possible.

      "We make a living by what we get, we make a life by what we give." --Winston Churchill

      J 1 Reply Last reply
      0
      • G George L Jackson

        Sorry, that is not possible.

        "We make a living by what we get, we make a life by what we give." --Winston Churchill

        J Offline
        J Offline
        Jamie Nordmeyer
        wrote on last edited by
        #3

        Crap. That's what I was thinking, but I was hoping someone would tell me that I was wrong. :cool: It'd be nice, though. :) Something like: <xs:attribute name="UserName" use="Conditional" test="some/xpath/@value=dmz"/>

        Kyosa Jamie Nordmeyer - Taekwondo Yi (2nd) Dan Portland, Oregon, USA
        www.defaultn.com

        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