Peter Kirk wrote:
in relational databases we have in general such things as "tables",
"columns", "primary keys", "foreign keys".
Are there corresponding entities in the xml world? Xml is used to
represent data (as a database is), and I was wondering how such things can
be managed with xml.
I have been given the task to develop a component (a program) which can
represent metadata in a generic form for many different types of data
source. I am just having trouble seeing the abstraction which can
represent an xml file and a relational database, so any help/advice would
be appreciated.
XML is used for describing tree structures. Relational databases can also be
used to describe tree structures (by using foreign keys), but they are not
limited to trees. E.g. in relational databases, you can have cyclic
references or entities with multiple "parents". Or a tuple referencing
another tuple, but you could not say that one is the "parent" of the other
one.
With XML by itself, you are limited to trees. Of course you could think of
mechanisms for cross-referencing an XML node from another node, but this
would then be part of a schema on top of XML.
So you cannot generally say things like "a column in a relational database
matches a node in XML" or so.
At most, you might say "a relational database matches an XML document".
On a more concrete level, you could however say things like: "A tuple in
this relation matches a certain kind of node (at a certain position) in an
XML document that conforms to a certain schema".
Best regards,
Felix