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. Schema and derived types

Schema and derived types

Scheduled Pinned Locked Moved XML / XSL
xmldatabasetestingbeta-testinghelp
2 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.
  • R Offline
    R Offline
    Russell Jones
    wrote on last edited by
    #1

    I'm trying to create a list containing subtypes of an abstract type in xml and validate it using an xml schema I tried to use this as a schema but when i try to validate i get an error telling me that I cannot use transaction because it's marked abstract. Basically I'm trying to end up with a list that contains transaction nodes some of which are of type transaction1 and some are transaction2.

    The code above is only for testing, I'm trying to get my head round how restriction etc works in schema. Does anyone know how to do this? Cheers, Russell

    E 1 Reply Last reply
    0
    • R Russell Jones

      I'm trying to create a list containing subtypes of an abstract type in xml and validate it using an xml schema I tried to use this as a schema but when i try to validate i get an error telling me that I cannot use transaction because it's marked abstract. Basically I'm trying to end up with a list that contains transaction nodes some of which are of type transaction1 and some are transaction2.

      The code above is only for testing, I'm trying to get my head round how restriction etc works in schema. Does anyone know how to do this? Cheers, Russell

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

      From what I can see, you have a couple of problems: * Everything is in lower-case, so complextype is not the same as the (correct) complexType. (This also applies to complexcontent/complexContent, etc) * The complexType 'transactions' contains a sequence that contains a choice. You cannot limit a choice in this way. Here is the right way: So I removed the choice to get it to work. For reference, here is what the final schema looks like:

      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