Two nested relations, but one is to itself

  • Thread starter Thread starter adimiller
  • Start date Start date
A

adimiller

Hi.

I have an XSD which describes a set of objects which one is both
contained in a parent, as well as referencing itself again
(recursively). XSD.exe doesn't like it very much and complains about:

"The same table cannot be the child table in two nested relations."

I have read all over the web about this, which seems to be a limitation
in .Net, but everywhere I read it is regarding an item which is
referenced by two different parents. My problem is a little different
and I was wondering if anyone has a solution.

I have full control over the XSD, but it must be standard (not MS
specific) and compliant.

My XML looks something like this:

<Root>
<Main>
<Name>Service</Name>
<pg>
<pg_name>One</pg_name>
<pg>
<pg_name>One_1</pg_name>
</pg>
</pg>
<pg>
<pg_name>Two</pg_name>
<pg>
<pg_name>Two_1</pg_name>
</pg>
</pg>
</Main>
</Root>

Both Main and pg are the parents of pg.

What XSD can describe this and be .Net friendly?

Thanks
 
I can only wonder if it is an absolute necessity to have a nested
relation. If you just need to have a relation, then you could relate
one column in pg to another column in pg. This is done often in SQL
queries that I have written, but you could certainly build this into the
schema. Hope that helps.

T
 
Back
Top