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. Handling same element with different types.

Handling same element with different types.

Scheduled Pinned Locked Moved XML / XSL
questionxmldatabasetutorial
2 Posts 2 Posters 3 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.
  • N Offline
    N Offline
    nay
    wrote on last edited by
    #1

    I've been givin the task of developing a schema for some message formats. The formats are in XML and they all use common elements except for one. The group element is different for each of the messages. one message it may be of type lineGroup of another bitGroup. My question is how can I make my schema take either type group? I've found that one element name with 2 types does not work. So what is the work around? I'm new to this so if there is something I'm missing please fill me in. TIA. example of the xml file (the <> were intentionally left out) in one file...

    group type="lineGroup"
    name message1 /name
    .
    .
    .
    /group

    In the other file

    group type="bitGroup"
    name message2 /name
    .
    .
    .
    /group

    nay

    M 1 Reply Last reply
    0
    • N nay

      I've been givin the task of developing a schema for some message formats. The formats are in XML and they all use common elements except for one. The group element is different for each of the messages. one message it may be of type lineGroup of another bitGroup. My question is how can I make my schema take either type group? I've found that one element name with 2 types does not work. So what is the work around? I'm new to this so if there is something I'm missing please fill me in. TIA. example of the xml file (the <> were intentionally left out) in one file...

      group type="lineGroup"
      name message1 /name
      .
      .
      .
      /group

      In the other file

      group type="bitGroup"
      name message2 /name
      .
      .
      .
      /group

      nay

      M Offline
      M Offline
      Michael A Barnhart
      wrote on last edited by
      #2

      This schema allows the attribute of the Group element names Type to be either LineGroup or BitGroup. To be conscious that you are ignorant of the facts is a great step towards Knowledge. Benjamin Disraeli

      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