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 unknown subclass [modified]

Validation of unknown subclass [modified]

Scheduled Pinned Locked Moved XML / XSL
questiondatabasexmlhelptutorial
1 Posts 1 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.
  • H Offline
    H Offline
    hase2407
    wrote on last edited by
    #1

    Hi, I have a problem with validation a list of different subclasses. The are all derived from one base class(ElementBase). I want to make the schema future-proof by adding a placeholder. Here a short example

    < xs:element name="Elements">
    < xs:complextype>
    < xs:choice minoccurs="0" maxoccurs="unbounded">
    < xs:element name="BaseElement" type="ElementBase" />
    < xs:element name="Sphere" type="ElementSphere" />
    < xs:element name="Cone" type="ElementCone" />
    < xs:element name="Cylinder" type="ElementCylinder" />
    HERE I need a placeholder
    < /xs:choice>
    < /xs:complextype>
    < /xs:element>

    My idea was to make another complex type with an any Parameter like followed.

    < xs:complextype name="FurtherElements">
    < xs:complexcontent>
    < xs:extension base="ElementBase">
    < xs:sequence>
    < xs:any minoccurs="0" maxoccurs="unbounded" />
    < /xs:sequence>
    < /xs:extension>
    < /xs:complexcontent>
    < /xs:complextype>

    But how do I put this into the choise statement? I still don't know the name of the future elements (but xs:element needs one: < xs:element name="" type ="FurtherElements"/>). Is there any workaround to solve this problem? Thanks a lot

    modified on Monday, June 9, 2008 4:53 AM

    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