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