I loaded the generated schema into VS.NET 2005 and it displayed good
diagram. It looks like you're trying to take the next step and load
relational tables into a dataset from an XML file. I would take a look at
"Typed DataSets" and create a separate typed dataset so you can examine the
code that gets generated. You'll need to find out how to create the
ForeignKeyConst raints, etc.
I would also recommend a book "Pragmatic ADO.NET" by Shawn Wildermuth since
it has several chapters on DataSets, Typed DataSets, etc.
Jerry
"Bill Nguyen" <bi**********@j aco.comwrote in message
news:26******** *************** ***********@mic rosoft.com...
Jerry;
You're correct.
I played with the new xsd and it seemed to work , but only for the 1st
table <transmissionHe aderin the dataset.
When I tried to read the <fuelPriceInfor ecord, I got error since
<terminaland <fuelproducta re nested.
Can you please help with the .readxml syntax for nested items?
Thanks
Bill
"Jerry N" <st******@newsg roup.nospamwrot e in message
news:u9******** ******@TK2MSFTN GP05.phx.gbl...
>Martin Honnen had an example buried in his message. I added it to the
FuelsDoc declarations as shown below. I also tested it on the web page
(http://www.xmlforasp.net/codebank/sy...enerator.aspx).
<?xml version="1.0"?>
<pcats:FuelsDo c
xmlns="http://www.naxml.org/Retail-EDI/Vocabulary/2003-10-16"
xmlns:xsi="htt p://www.w3.org/2001/XMLSchema-instance"
xmlns:pcats="h ttp://example.com/ns1"
xsi:schemaLoca tion="NAXML-FuelPrice15.xsd ">
<pcats:Transmi ssionHeader>
<pcats:Transmi ssionId>2007060 40938</pcats:Transmiss ionId>
<pcats:Transmi ssionDate>2007-06-04</pcats:Transmiss ionDate>
<pcats:Transmi ssionTime>09:38 :19-06:00</pcats:Transmiss ionTime>
<pcats:Transmi ssionStatus>ori ginal</pcats:Transmiss ionStatus>
<pcats:Transmi ssionSender>Ape x Oil</pcats:Transmiss ionSender>
<pcats:Transmi ssionAgency>DTN Integrated
Services/dtnDataConnect</pcats:Transmiss ionAgency>
</pcats:Transmiss ionHeader>
><pcats:FuelPri ceInfo>
><pcats:Termina l>
><pcats:Name identType="Plan tNumber" ident="1070">
<pcats:NamePre fix>Frsn KMEP</pcats:NamePrefi x>
</pcats:Name>
><pcats:City>Fr esno</pcats:City>
<pcats:State>C A</pcats:State>
><pcats:FuelPro duct><pcats:Eff ectiveDate>2007-06-04</pcats:Effective Date>
<pcats:Effecti veTime>10:00:00 </pcats:Effective Time>
<pcats:FuelPro ductId identType="Ultr a Low Sulfur CARB
#2">0402</pcats:FuelProdu ctId>
<pcats:Price>2 .240000</pcats:Price>
<pcats:NetChan ge>.040000</pcats:NetChange >
</pcats:FuelProdu ct>
></pcats:Terminal>
></pcats:FuelPrice Info>
></pcats:FuelsDoc>
"Bill Nguyen" <bi************ *****@jaco.comw rote in message
news:u1******* ******@TK2MSFTN GP05.phx.gbl...
>>Jerry;
Where do I need to add the 'pcats' namespace declaration?
THanks
Bill
"Jerry N" <st******@newsg roup.nospamwrot e in message
news:uX****** ********@TK2MSF TNGP03.phx.gbl. ..
Yes, I removed the 'pcats' prefix to get it to work. I forgot to
include it in my original reply. When you add the namespace
declaratio n, I hope this web page works better.
Jerry
"Bill Nguyen" <bi************ *****@jaco.comw rote in message
news:eN***** ********@TK2MSF TNGP05.phx.gbl. ..
Jerry;
I got an error message regarding 'pcats' namespace is undeclared. It
seems to me that 'pcats' was removed from the xsd file you generated!
>
Thanks
>
Bill
"Jerry N" <st******@newsg roup.nospamwrot e in message
news:%2**** ***********@TK2 MSFTNGP05.phx.g bl...
>I've used this XSD generator and like the output:
>http://www.xmlforasp.net/codebank/sy...Generator.aspx
>>
>Here's the output (after I made some minor changes to make it a valid
>XML message):
>>
><?xml version="1.0" encoding="utf-16"?>
><xs:sche ma id="FuelsDoc"
>targetName space="http://www.naxml.org/Retail-EDI/Vocabulary/2003-10-16"
>xmlns:mstn s="http://www.naxml.org/Retail-EDI/Vocabulary/2003-10-16"
>xmlns="htt p://www.naxml.org/Retail-EDI/Vocabulary/2003-10-16"
>xmlns:xs=" http://www.w3.org/2001/XMLSchema"
>xmlns:msda ta="urn:schema s-microsoft-com:xml-msdata"
>attributeF ormDefault="qua lified" elementFormDefa ult="qualified" >
> <xs:element name="FuelsDoc" msdata:IsDataSe t="true"
>msdata:Use CurrentLocale=" true">
> <xs:complexType >
> <xs:choice minOccurs="0" maxOccurs="unbo unded">
> <xs:element name="Transmiss ionHeader">
> <xs:complexType >
> <xs:sequence>
> <xs:element name="Transmiss ionId" type="xs:string "
>minOccurs= "0" />
> <xs:element name="Transmiss ionDate" type="xs:string "
>minOccurs= "0" />
> <xs:element name="Transmiss ionTime" type="xs:string "
>minOccurs= "0" />
> <xs:element name="Transmiss ionStatus" type="xs:string "
>minOccurs= "0" />
> <xs:element name="Transmiss ionSender" type="xs:string "
>minOccurs= "0" />
> <xs:element name="Transmiss ionAgency" type="xs:string "
>minOccurs= "0" />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="FuelPrice Info">
> <xs:complexType >
> <xs:sequence>
> <xs:element name="Terminal" minOccurs="0"
>maxOccurs= "unbounded" >
> <xs:complexType >
> <xs:sequence>
> <xs:element name="City" type="xs:string "
>minOccurs= "0" />
> <xs:element name="State" type="xs:string "
>minOccurs= "0" />
> <xs:element name="Name" minOccurs="0"
>maxOccurs= "unbounded" >
> <xs:complexType >
> <xs:sequence>
> <xs:element name="NamePrefi x"
>type="xs:s tring" minOccurs="0" msdata:Ordinal= "0" />
> </xs:sequence>
> <xs:attribute name="identType "
>form="unqu alified" type="xs:string " />
> <xs:attribute name="ident" form="unqualifi ed"
>type="xs:s tring" />
> </xs:complexType>
> </xs:element>
> <xs:element name="FuelProdu ct" minOccurs="0"
>maxOccurs= "unbounded" >
> <xs:complexType >
> <xs:sequence>
> <xs:element name="Effective Date"
>type="xs:s tring" minOccurs="0" />
> <xs:element name="Effective Time"
>type="xs:s tring" minOccurs="0" />
> <xs:element name="Price" type="xs:string "
>minOccurs= "0" />
> <xs:element name="NetChange "
>type="xs:s tring" minOccurs="0" />
> <xs:element name="FuelProdu ctId"
>nillable=" true" minOccurs="0" maxOccurs="unbo unded">
> <xs:complexType >
> <xs:simpleConte nt
>msdata:Col umnName="FuelPr oductId_Text" msdata:Ordinal= "1">
> <xs:extension base="xs:string ">
> <xs:attribute name="identType "
>form="unqu alified" type="xs:string " />
> </xs:extension>
> </xs:simpleConten t>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:choice>
> </xs:complexType>
> </xs:element>
></xs:schema>
>>
>"Bill Nguyen" <bi************ *****@jaco.comw rote in message
>news:%2*** *************@T K2MSFTNGP04.phx .gbl...
>>Is it possible to create your won XSD to use with .NET based on an
>>XML content?
>>For example the one below:
>>>
>><?xml version="1.0"?>
>><pcats:Fu elsDoc
>>xmlns="ht tp://www.naxml.org/Retail-EDI/Vocabulary/2003-10-16"
>>xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance"
>>xsi:schem aLocation="NAXM L-FuelPrice15.xsd ">
>><pcats:Tr ansmissionHeade r>
>><pcats:Tr ansmissionId>20 0706040938</pcats:Transmiss ionId>
>><pcats:Tr ansmissionDate> 2007-06-04</pcats:Transmiss ionDate>
>><pcats:Tr ansmissionTime> 09:38:19-06:00</pcats:Transmiss ionTime>
>><pcats:Tr ansmissionStatu s>original</pcats:Transmiss ionStatus>
>><pcats:Tr ansmissionSende r>Apex Oil</pcats:Transmiss ionSender>
>><pcats:Tr ansmissionAgenc y>DTN Integrated
>>Service s/dtnDataConnect</pcats:Transmiss ionAgency>
>></pcats:Transmiss ionHeader>
>><pcats:Fu elPriceInfo>
>><pcats:Te rminal>
>><pcats:Na me identType="Plan tNumber" ident="1070">
>><pcats:Na mePrefix>Frsn KMEP</pcats:NamePrefi x>
>></pcats:Name>
>><pcats:Ci ty>Fresno</pcats:City>
>><pcats:St ate>CA</pcats:State>
>><pcats:Fu elProduct><pcat s:EffectiveDate >2007-06-04</pcats:Effective Date>
>><pcats:Ef fectiveTime>10: 00:00</pcats:Effective Time>
>><pcats:Fu elProductId identType="Ultr a Low Sulfur CARB
>>#2">040 2</pcats:FuelProdu ctId>
>><pcats:Pr ice>2.240000</pcats:Price>
>><pcats:Ne tChange>.040000 </pcats:NetChange >
>></pcats:FuelProdu ct>
>></pcats:Terminal>
>></pcats:FuelPrice Info>
>></pcats:FuelsDoc>
>>>
>>Thanks
>>>
>>Bill
>>>
>>>
>>>
>>
>>
>
>