I've been setting up a schema with the XML Designer in VS .NET 2003.
The designer lets me set up a lot of things including a complex type that
contains an unnamed complex type called modified.
When I try to preview the dataset, I get an error described as "The same
table (modified) cannot be the child table in two nested relations.
I've run into this before with a different complex type, and I've changed
the name of the instance of the type in the various elements it's used, and
the problem goes away.
In this case, problem is an unnamed complex type, so it only appears once in
the schema where it is declared inside of the named complex type it is used.
The point is that I cannot change the name of each of the instances that it's
being used in as the are simply declared by the name of the containing
complex type
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema targetNamespace="http://tempuri.org/XMLSchema.xsd"
elementFormDefault="qualified"
xmlns="http://tempuri.org/XMLSchema.xsd"
xmlns:mstns="http://tempuri.org/XMLSchema.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="ExperimentalData_x0020_">
<xs:complexType>
<xs:all>
<xs:element name="runcontext">
<xs:complexType>
<xs:all>
<xs:element name="wfFluorsPersistent" type="mstns:fluorpersistent" />
</xs:all>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
<xs:complexType name="fluorpersistent">
<xs:all>
<xs:element name="wfFluor_x0020_">
<xs:complexType>
<xs:all>
<xs:element name="problemelement" type="mstns:problemelement" />
<xs:element name="fluor" type="mstns:flour" />
</xs:all>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
<xs:complexType name="flour">
<xs:all>
<xs:element name="usage">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Reporter" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="name" type="xs:string" />
<xs:element name="deleted" type="xs:boolean" />
<xs:element name="units" type="unitofmeasurement" />
<xs:element name="color" type="mstns:fluorcolors" />
<xs:element name="fproblemelement" type="mstns:problemelement" />
</xs:all>
<xs:attribute name="id" type="xs:short" />
</xs:complexType>
<xs:complexType name="unitofmeasurement">
<xs:all>
<xs:element name="unit" type="mstns:siunit" />
<xs:element name="prefix" type="mstns:siprefix" />
</xs:all>
</xs:complexType>
<xs:simpleType name="siunit">
<xs:restriction base="xs:string">
<xs:enumeration value="meter" />
<xs:enumeration value="gram" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="problemelement">
<xs:all minOccurs="1" maxOccurs="1">
<xs:element name="id" type="xs:short" />
<xs:element name="problem" type="mstns:filter" />
<xs:element name="recession" type="mstns:filter" />
</xs:all>
</xs:complexType>
<xs:simpleType name="siprefix">
<xs:restriction base="xs:string">
<xs:enumeration value="yocto" />
<xs:enumeration value="zepto" />
<xs:enumeration value="atto" />
<xs:enumeration value="yotta" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="fluorcolors">
<xs:restriction base="xs:string">
<xs:enumeration value="Lime" />
<xs:enumeration value="Green" />
<xs:enumeration value="SkyBlue" />
<xs:enumeration value="Black" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="filter">
<xs:all minOccurs="1" maxOccurs="1">
<xs:element name="id" type="xs:short" />
<xs:element name="type" type="xs:short" />
<xs:element name="name" type="xs:string" />
</xs:all>
</xs:complexType>
</xs:schema>
any suggestions? 4 5726
This is a limitation of DataSet in VS .NET 2003.
It has been fixed in VS .NET 2005.
"Alfetta159" <Al********@discussions.microsoft.com> wrote in message
news:27**********************************@microsof t.com... I've been setting up a schema with the XML Designer in VS .NET 2003.
The designer lets me set up a lot of things including a complex type that contains an unnamed complex type called modified.
When I try to preview the dataset, I get an error described as "The same table (modified) cannot be the child table in two nested relations.
I've run into this before with a different complex type, and I've changed the name of the instance of the type in the various elements it's used, and the problem goes away.
In this case, problem is an unnamed complex type, so it only appears once in the schema where it is declared inside of the named complex type it is used. The point is that I cannot change the name of each of the instances that it's being used in as the are simply declared by the name of the containing complex type
<?xml version="1.0" encoding="utf-8" ?> <xs:schema targetNamespace="http://tempuri.org/XMLSchema.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/XMLSchema.xsd" xmlns:mstns="http://tempuri.org/XMLSchema.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="ExperimentalData_x0020_"> <xs:complexType> <xs:all> <xs:element name="runcontext"> <xs:complexType> <xs:all> <xs:element name="wfFluorsPersistent" type="mstns:fluorpersistent" /> </xs:all> </xs:complexType> </xs:element> </xs:all> </xs:complexType> </xs:element> <xs:complexType name="fluorpersistent"> <xs:all> <xs:element name="wfFluor_x0020_"> <xs:complexType> <xs:all> <xs:element name="problemelement" type="mstns:problemelement" /> <xs:element name="fluor" type="mstns:flour" /> </xs:all> </xs:complexType> </xs:element> </xs:all> </xs:complexType> <xs:complexType name="flour"> <xs:all> <xs:element name="usage"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="Reporter" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="name" type="xs:string" /> <xs:element name="deleted" type="xs:boolean" /> <xs:element name="units" type="unitofmeasurement" /> <xs:element name="color" type="mstns:fluorcolors" /> <xs:element name="fproblemelement" type="mstns:problemelement" /> </xs:all> <xs:attribute name="id" type="xs:short" /> </xs:complexType> <xs:complexType name="unitofmeasurement"> <xs:all> <xs:element name="unit" type="mstns:siunit" /> <xs:element name="prefix" type="mstns:siprefix" /> </xs:all> </xs:complexType> <xs:simpleType name="siunit"> <xs:restriction base="xs:string"> <xs:enumeration value="meter" /> <xs:enumeration value="gram" /> </xs:restriction> </xs:simpleType> <xs:complexType name="problemelement"> <xs:all minOccurs="1" maxOccurs="1"> <xs:element name="id" type="xs:short" /> <xs:element name="problem" type="mstns:filter" /> <xs:element name="recession" type="mstns:filter" /> </xs:all> </xs:complexType> <xs:simpleType name="siprefix"> <xs:restriction base="xs:string"> <xs:enumeration value="yocto" /> <xs:enumeration value="zepto" /> <xs:enumeration value="atto" /> <xs:enumeration value="yotta" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="fluorcolors"> <xs:restriction base="xs:string"> <xs:enumeration value="Lime" /> <xs:enumeration value="Green" /> <xs:enumeration value="SkyBlue" /> <xs:enumeration value="Black" /> </xs:restriction> </xs:simpleType> <xs:complexType name="filter"> <xs:all minOccurs="1" maxOccurs="1"> <xs:element name="id" type="xs:short" /> <xs:element name="type" type="xs:short" /> <xs:element name="name" type="xs:string" /> </xs:all> </xs:complexType> </xs:schema>
any suggestions?
Grrrr...
I had a feeling I would get this answer.
Thanks,
"Chris Lovett" wrote: This is a limitation of DataSet in VS .NET 2003. It has been fixed in VS .NET 2005.
"Alfetta159" <Al********@discussions.microsoft.com> wrote in message news:27**********************************@microsof t.com... I've been setting up a schema with the XML Designer in VS .NET 2003.
The designer lets me set up a lot of things including a complex type that contains an unnamed complex type called modified.
When I try to preview the dataset, I get an error described as "The same table (modified) cannot be the child table in two nested relations.
I've run into this before with a different complex type, and I've changed the name of the instance of the type in the various elements it's used, and the problem goes away.
In this case, problem is an unnamed complex type, so it only appears once in the schema where it is declared inside of the named complex type it is used. The point is that I cannot change the name of each of the instances that it's being used in as the are simply declared by the name of the containing complex type
<?xml version="1.0" encoding="utf-8" ?> <xs:schema targetNamespace="http://tempuri.org/XMLSchema.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/XMLSchema.xsd" xmlns:mstns="http://tempuri.org/XMLSchema.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="ExperimentalData_x0020_"> <xs:complexType> <xs:all> <xs:element name="runcontext"> <xs:complexType> <xs:all> <xs:element name="wfFluorsPersistent" type="mstns:fluorpersistent" /> </xs:all> </xs:complexType> </xs:element> </xs:all> </xs:complexType> </xs:element> <xs:complexType name="fluorpersistent"> <xs:all> <xs:element name="wfFluor_x0020_"> <xs:complexType> <xs:all> <xs:element name="problemelement" type="mstns:problemelement" /> <xs:element name="fluor" type="mstns:flour" /> </xs:all> </xs:complexType> </xs:element> </xs:all> </xs:complexType> <xs:complexType name="flour"> <xs:all> <xs:element name="usage"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="Reporter" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="name" type="xs:string" /> <xs:element name="deleted" type="xs:boolean" /> <xs:element name="units" type="unitofmeasurement" /> <xs:element name="color" type="mstns:fluorcolors" /> <xs:element name="fproblemelement" type="mstns:problemelement" /> </xs:all> <xs:attribute name="id" type="xs:short" /> </xs:complexType> <xs:complexType name="unitofmeasurement"> <xs:all> <xs:element name="unit" type="mstns:siunit" /> <xs:element name="prefix" type="mstns:siprefix" /> </xs:all> </xs:complexType> <xs:simpleType name="siunit"> <xs:restriction base="xs:string"> <xs:enumeration value="meter" /> <xs:enumeration value="gram" /> </xs:restriction> </xs:simpleType> <xs:complexType name="problemelement"> <xs:all minOccurs="1" maxOccurs="1"> <xs:element name="id" type="xs:short" /> <xs:element name="problem" type="mstns:filter" /> <xs:element name="recession" type="mstns:filter" /> </xs:all> </xs:complexType> <xs:simpleType name="siprefix"> <xs:restriction base="xs:string"> <xs:enumeration value="yocto" /> <xs:enumeration value="zepto" /> <xs:enumeration value="atto" /> <xs:enumeration value="yotta" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="fluorcolors"> <xs:restriction base="xs:string"> <xs:enumeration value="Lime" /> <xs:enumeration value="Green" /> <xs:enumeration value="SkyBlue" /> <xs:enumeration value="Black" /> </xs:restriction> </xs:simpleType> <xs:complexType name="filter"> <xs:all minOccurs="1" maxOccurs="1"> <xs:element name="id" type="xs:short" /> <xs:element name="type" type="xs:short" /> <xs:element name="name" type="xs:string" /> </xs:all> </xs:complexType> </xs:schema>
any suggestions?
But you could run an XSL transform over your XML to rename some elements
then import that into a DataSet then do the reverse transform when you
reserialize the updated DataSet.
"Alfetta159" <Al********@discussions.microsoft.com> wrote in message
news:21**********************************@microsof t.com... Grrrr...
I had a feeling I would get this answer.
Thanks,
"Chris Lovett" wrote:
This is a limitation of DataSet in VS .NET 2003. It has been fixed in VS .NET 2005.
"Alfetta159" <Al********@discussions.microsoft.com> wrote in message news:27**********************************@microsof t.com... > I've been setting up a schema with the XML Designer in VS .NET 2003. > > The designer lets me set up a lot of things including a complex type > that > contains an unnamed complex type called modified. > > When I try to preview the dataset, I get an error described as "The > same > table (modified) cannot be the child table in two nested relations. > > I've run into this before with a different complex type, and I've > changed > the name of the instance of the type in the various elements it's used, > and > the problem goes away. > > In this case, problem is an unnamed complex type, so it only appears > once > in > the schema where it is declared inside of the named complex type it is > used. > The point is that I cannot change the name of each of the instances > that > it's > being used in as the are simply declared by the name of the containing > complex type > > > <?xml version="1.0" encoding="utf-8" ?> > <xs:schema targetNamespace="http://tempuri.org/XMLSchema.xsd" > elementFormDefault="qualified" > xmlns="http://tempuri.org/XMLSchema.xsd" > xmlns:mstns="http://tempuri.org/XMLSchema.xsd" > xmlns:xs="http://www.w3.org/2001/XMLSchema"> > <xs:element name="ExperimentalData_x0020_"> > <xs:complexType> > <xs:all> > <xs:element name="runcontext"> > <xs:complexType> > <xs:all> > <xs:element name="wfFluorsPersistent" type="mstns:fluorpersistent" /> > </xs:all> > </xs:complexType> > </xs:element> > </xs:all> > </xs:complexType> > </xs:element> > <xs:complexType name="fluorpersistent"> > <xs:all> > <xs:element name="wfFluor_x0020_"> > <xs:complexType> > <xs:all> > <xs:element name="problemelement" type="mstns:problemelement" /> > <xs:element name="fluor" type="mstns:flour" /> > </xs:all> > </xs:complexType> > </xs:element> > </xs:all> > </xs:complexType> > <xs:complexType name="flour"> > <xs:all> > <xs:element name="usage"> > <xs:simpleType> > <xs:restriction base="xs:string"> > <xs:enumeration value="Reporter" /> > </xs:restriction> > </xs:simpleType> > </xs:element> > <xs:element name="name" type="xs:string" /> > <xs:element name="deleted" type="xs:boolean" /> > <xs:element name="units" type="unitofmeasurement" /> > <xs:element name="color" type="mstns:fluorcolors" /> > <xs:element name="fproblemelement" type="mstns:problemelement" /> > </xs:all> > <xs:attribute name="id" type="xs:short" /> > </xs:complexType> > <xs:complexType name="unitofmeasurement"> > <xs:all> > <xs:element name="unit" type="mstns:siunit" /> > <xs:element name="prefix" type="mstns:siprefix" /> > </xs:all> > </xs:complexType> > <xs:simpleType name="siunit"> > <xs:restriction base="xs:string"> > <xs:enumeration value="meter" /> > <xs:enumeration value="gram" /> > </xs:restriction> > </xs:simpleType> > <xs:complexType name="problemelement"> > <xs:all minOccurs="1" maxOccurs="1"> > <xs:element name="id" type="xs:short" /> > <xs:element name="problem" type="mstns:filter" /> > <xs:element name="recession" type="mstns:filter" /> > </xs:all> > </xs:complexType> > <xs:simpleType name="siprefix"> > <xs:restriction base="xs:string"> > <xs:enumeration value="yocto" /> > <xs:enumeration value="zepto" /> > <xs:enumeration value="atto" /> > <xs:enumeration value="yotta" /> > </xs:restriction> > </xs:simpleType> > <xs:simpleType name="fluorcolors"> > <xs:restriction base="xs:string"> > <xs:enumeration value="Lime" /> > <xs:enumeration value="Green" /> > <xs:enumeration value="SkyBlue" /> > <xs:enumeration value="Black" /> > </xs:restriction> > </xs:simpleType> > <xs:complexType name="filter"> > <xs:all minOccurs="1" maxOccurs="1"> > <xs:element name="id" type="xs:short" /> > <xs:element name="type" type="xs:short" /> > <xs:element name="name" type="xs:string" /> > </xs:all> > </xs:complexType> > </xs:schema> > > any suggestions?
Chris,
This idea looks great and trying to understand more deeply. You mean
transform the original XML into a regrouped xml document(changing the
conflicting names), and then load that xml document into a typed dataset.
Then do the reverse if needs to be deserialized. If this is correct do u have
any sample xslt which does this(I need the transformed output in an xml file).
Thanks,
Kris
"Chris Lovett" wrote: But you could run an XSL transform over your XML to rename some elements then import that into a DataSet then do the reverse transform when you reserialize the updated DataSet.
"Alfetta159" <Al********@discussions.microsoft.com> wrote in message news:21**********************************@microsof t.com... Grrrr...
I had a feeling I would get this answer.
Thanks,
"Chris Lovett" wrote:
This is a limitation of DataSet in VS .NET 2003. It has been fixed in VS .NET 2005.
"Alfetta159" <Al********@discussions.microsoft.com> wrote in message news:27**********************************@microsof t.com... > I've been setting up a schema with the XML Designer in VS .NET 2003. > > The designer lets me set up a lot of things including a complex type > that > contains an unnamed complex type called modified. > > When I try to preview the dataset, I get an error described as "The > same > table (modified) cannot be the child table in two nested relations. > > I've run into this before with a different complex type, and I've > changed > the name of the instance of the type in the various elements it's used, > and > the problem goes away. > > In this case, problem is an unnamed complex type, so it only appears > once > in > the schema where it is declared inside of the named complex type it is > used. > The point is that I cannot change the name of each of the instances > that > it's > being used in as the are simply declared by the name of the containing > complex type > > > <?xml version="1.0" encoding="utf-8" ?> > <xs:schema targetNamespace="http://tempuri.org/XMLSchema.xsd" > elementFormDefault="qualified" > xmlns="http://tempuri.org/XMLSchema.xsd" > xmlns:mstns="http://tempuri.org/XMLSchema.xsd" > xmlns:xs="http://www.w3.org/2001/XMLSchema"> > <xs:element name="ExperimentalData_x0020_"> > <xs:complexType> > <xs:all> > <xs:element name="runcontext"> > <xs:complexType> > <xs:all> > <xs:element name="wfFluorsPersistent" type="mstns:fluorpersistent" /> > </xs:all> > </xs:complexType> > </xs:element> > </xs:all> > </xs:complexType> > </xs:element> > <xs:complexType name="fluorpersistent"> > <xs:all> > <xs:element name="wfFluor_x0020_"> > <xs:complexType> > <xs:all> > <xs:element name="problemelement" type="mstns:problemelement" /> > <xs:element name="fluor" type="mstns:flour" /> > </xs:all> > </xs:complexType> > </xs:element> > </xs:all> > </xs:complexType> > <xs:complexType name="flour"> > <xs:all> > <xs:element name="usage"> > <xs:simpleType> > <xs:restriction base="xs:string"> > <xs:enumeration value="Reporter" /> > </xs:restriction> > </xs:simpleType> > </xs:element> > <xs:element name="name" type="xs:string" /> > <xs:element name="deleted" type="xs:boolean" /> > <xs:element name="units" type="unitofmeasurement" /> > <xs:element name="color" type="mstns:fluorcolors" /> > <xs:element name="fproblemelement" type="mstns:problemelement" /> > </xs:all> > <xs:attribute name="id" type="xs:short" /> > </xs:complexType> > <xs:complexType name="unitofmeasurement"> > <xs:all> > <xs:element name="unit" type="mstns:siunit" /> > <xs:element name="prefix" type="mstns:siprefix" /> > </xs:all> > </xs:complexType> > <xs:simpleType name="siunit"> > <xs:restriction base="xs:string"> > <xs:enumeration value="meter" /> > <xs:enumeration value="gram" /> > </xs:restriction> > </xs:simpleType> > <xs:complexType name="problemelement"> > <xs:all minOccurs="1" maxOccurs="1"> > <xs:element name="id" type="xs:short" /> > <xs:element name="problem" type="mstns:filter" /> > <xs:element name="recession" type="mstns:filter" /> > </xs:all> > </xs:complexType> > <xs:simpleType name="siprefix"> > <xs:restriction base="xs:string"> > <xs:enumeration value="yocto" /> > <xs:enumeration value="zepto" /> > <xs:enumeration value="atto" /> > <xs:enumeration value="yotta" /> > </xs:restriction> > </xs:simpleType> > <xs:simpleType name="fluorcolors"> > <xs:restriction base="xs:string"> > <xs:enumeration value="Lime" /> > <xs:enumeration value="Green" /> > <xs:enumeration value="SkyBlue" /> > <xs:enumeration value="Black" /> > </xs:restriction> > </xs:simpleType> > <xs:complexType name="filter"> > <xs:all minOccurs="1" maxOccurs="1"> > <xs:element name="id" type="xs:short" /> > <xs:element name="type" type="xs:short" /> > <xs:element name="name" type="xs:string" /> > </xs:all> > </xs:complexType> > </xs:schema> > > any suggestions? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Kenneth Osenbroch |
last post by:
Hi. I want to create a trigger that only allows delete from table A if
corresponding record in table B does not exist. Any idea on how this
can be done? Thanks, Kenneth.
|
by: Max |
last post by:
Suppose we have an object hierarchy in XSD.
For example, let us take Control, Label, TextBox and LinkLabel windows
controls.
Each control has some properties which are represented as elements....
|
by: Brian Kedersha |
last post by:
We created a XML Schema that has nested table relations. We had the
following Warning message come up.
An unhandled exception of the type 'System.ArgumentException' occurred in
system.data.dll...
|
by: martin |
last post by:
Please help if you can.
I created a table to relate to another. I believe that I created it
correctly with all the requirements. I even checked my steps out of a
mcGraw 2003 book.
The...
|
by: sam |
last post by:
i get the following error while reading an xml into a dataset
The same table cannot be the child table in two nested relation
is there a solution for it
|
by: What-a-Tool |
last post by:
I am trying to write a program that will take all the members of a data
base, add them to a tree, with all child relations as sub-nodes.
I am having a problem getting the parent child relations...
|
by: polocar |
last post by:
Hi,
I'm writing a program in Visual C# 2005 Professional Edition.
This program connects to a SQL Server 2005 database called
"Generations" (in which there is only one table, called...
|
by: chathura86 |
last post by:
hi,
i have a table which has child rows in another table. Now i want to truncate this
table temporally, because i will re-enter those values in a short time with some changes. cannot use update...
|
by: mathieu |
last post by:
Hi,
I am trying to generate xsd from xml, but all tools I have tried so
far returns:
"The table (sequence) cannot be the child table to itself in nested
relations."
Is this something you...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |