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. Help for newbie

Help for newbie

Scheduled Pinned Locked Moved XML / XSL
xmlhelpquestionannouncement
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.
  • K Offline
    K Offline
    Konstantin Yazvinski
    wrote on last edited by
    #1

    I need to represent hierarchy of people who work under over persons I did it next way:

    <?xml version="1.0" encoding="utf-8"?>
    <person>
    <name>Al</name>
    <title>God</title>
    <employees>
    <person>
    <name>Bart</name>
    <title>Human</title>
    <employees></employees>
    </person>
    <person>
    <name>Lisa</name>
    <title>Woman</title>
    <employees></employees>
    </person>
    <person>
    <name>Lionardo</name>
    <title>Father</title>
    <employees>
    <person>
    <name>Jim</name>
    <title>Son</title>
    <employees>
    <person>
    <name>Jim 2nd</name>
    <title>Sub son</title>
    <employees></employees>
    </person>
    </employees>
    </person>
    </employees>
    </person>
    </employees>
    </person>

    Is that right way to do that? any help will appreciated!

    L 1 Reply Last reply
    0
    • K Konstantin Yazvinski

      I need to represent hierarchy of people who work under over persons I did it next way:

      <?xml version="1.0" encoding="utf-8"?>
      <person>
      <name>Al</name>
      <title>God</title>
      <employees>
      <person>
      <name>Bart</name>
      <title>Human</title>
      <employees></employees>
      </person>
      <person>
      <name>Lisa</name>
      <title>Woman</title>
      <employees></employees>
      </person>
      <person>
      <name>Lionardo</name>
      <title>Father</title>
      <employees>
      <person>
      <name>Jim</name>
      <title>Son</title>
      <employees>
      <person>
      <name>Jim 2nd</name>
      <title>Sub son</title>
      <employees></employees>
      </person>
      </employees>
      </person>
      </employees>
      </person>
      </employees>
      </person>

      Is that right way to do that? any help will appreciated!

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      Konstantin Yazvinski wrote:

      Is that right way to do that?

      It's valid XML so if that is your requirement then yes it's right. Or The "right" way is dependent on your requirements. There could be many potential problems with the circular dependencies of person and employees. Well Formed XML has no problem with that but other things you might require could. Things like an ORM tool, Database Scheme or Serialization framework.

      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