Tuesday, March 27, 2012

Bulk Load - In a Panic Need Help... PLEASE!

Please help I am new to XML and Schema will someone look this over and tell
me what I am doing wrong?
Ok, I receive inventory updates once a week from my vendor in the following
format: (Obviously trimmed down)
<?xml version="1.0" encoding="UTF-8"?>
<AvailableBatch>
<Date>08/14/2005</Date>
<Available>
<Sku>40</Sku>
<Part>10 </Part>
<Location>20</Location>
<Qty>0</Qty>
<Time>07:20:09</Time>
<Detail>
<Desc>TIGHTS, MENS</Desc>
<Price>14.90</Price>
</Detail>
</Available>
<Available>
<Sku>REPEAT OVER 10000 TIMES</Sku>
<Part>1REPEAT OVER 10000 TIMES</Part>
<Location>REPEAT OVER 10000 TIMES</Location>
<Qty>REPEAT OVER 10000 TIMES</Qty>
<Time>REPEAT OVER 10000 TIMES</Time>
<Detail>
<Desc>REPEAT OVER 10000 TIMES</Desc>
<Price>REPEAT OVER 10000 TIMES</Price>
</Detail>
</Available>
</AvailableBatch>
tonight I picked through tutorials to try to setup my schema file... I know
this is wrong... Im just at a loss as to why? Now please keep in mind that
the above xml file only has the date once and then repeats the "<Available>"
section thousands of times:
Schema File:
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="XMLSchema"
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="AvailableBatch">
<xs:complexType>
<xs:sequence>
<xs:element name ="Date">
<xs:complexType>
<xs:sequence id="Available">
<xs:element name ="Sku" type ="xs:string" maxOccurs
="unbounded"/>
<xs:element name ="Part" type ="xs:string" maxOccurs
="unbounded"/>
<xs:element name ="Location" type ="xs:string" maxOccurs
="unbounded"/>
<xs:element name ="Qty" type ="xs:string" maxOccurs
="unbounded"/>
<xs:element name ="Time" type ="xs:string" maxOccurs
="unbounded"/>
<xs:sequence id ="Detail">
<xs:element name ="Description" type ="xs:string" maxOccurs
="unbounded"/>
<xs:element name ="Price" type ="xs:string" maxOccurs
="unbounded"/>
</xs:sequence>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
I have a tuesday deadline to get this data into my data base... can someone
please give me a hand?
I really appreciate whoever can take their time to help me... You have no
idea how much I appreciate it!
Aaron
I did find a schema generator: Would this be correct or is this wrong?
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:element name="AvailableBatch">
<xs:complexType>
<xs:sequence>
<xs:element ref="Date"/>
<xs:element maxOccurs="unbounded" ref="Available"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Date" type="xs:string"/>
<xs:element name="Available">
<xs:complexType>
<xs:sequence>
<xs:element ref="Sku"/>
<xs:element ref="Part"/>
<xs:element ref="Location"/>
<xs:element ref="Qty"/>
<xs:element ref="Time"/>
<xs:element ref="Detail"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Sku" type="xs:integer"/>
<xs:element name="Part" type="xs:string"/>
<xs:element name="Location" type="xs:integer"/>
<xs:element name="Qty" type="xs:integer"/>
<xs:element name="Time" type="xs:NMTOKEN"/>
<xs:element name="Detail">
<xs:complexType>
<xs:sequence>
<xs:element ref="Desc"/>
<xs:element minOccurs="0" ref="Weight"/>
<xs:element minOccurs="0" ref="Price"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Desc" type="xs:string"/>
<xs:element name="Weight" type="xs:decimal"/>
<xs:element name="Price" type="xs:decimal"/>
</xs:schema>
Aaron C wrote:
>Please help I am new to XML and Schema will someone look this over and tell
>me what I am doing wrong?
>Ok, I receive inventory updates once a week from my vendor in the following
>format: (Obviously trimmed down)
><?xml version="1.0" encoding="UTF-8"?>
><AvailableBatch>
> <Date>08/14/2005</Date>
> <Available>
> <Sku>40</Sku>
> <Part>10 </Part>
> <Location>20</Location>
> <Qty>0</Qty>
> <Time>07:20:09</Time>
> <Detail>
> <Desc>TIGHTS, MENS</Desc>
> <Price>14.90</Price>
> </Detail>
> </Available>
><Available>
> <Sku>REPEAT OVER 10000 TIMES</Sku>
> <Part>1REPEAT OVER 10000 TIMES</Part>
> <Location>REPEAT OVER 10000 TIMES</Location>
> <Qty>REPEAT OVER 10000 TIMES</Qty>
> <Time>REPEAT OVER 10000 TIMES</Time>
> <Detail>
> <Desc>REPEAT OVER 10000 TIMES</Desc>
> <Price>REPEAT OVER 10000 TIMES</Price>
> </Detail>
> </Available>
></AvailableBatch>
>tonight I picked through tutorials to try to setup my schema file... I know
>this is wrong... Im just at a loss as to why? Now please keep in mind that
>the above xml file only has the date once and then repeats the "<Available>"
>section thousands of times:
>Schema File:
><?xml version="1.0" encoding="utf-8" ?>
><xs:schema id="XMLSchema"
> 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="AvailableBatch">
> <xs:complexType>
> <xs:sequence>
> <xs:element name ="Date">
> <xs:complexType>
> <xs:sequence id="Available">
> <xs:element name ="Sku" type ="xs:string" maxOccurs
>="unbounded"/>
> <xs:element name ="Part" type ="xs:string" maxOccurs
>="unbounded"/>
> <xs:element name ="Location" type ="xs:string" maxOccurs
>="unbounded"/>
> <xs:element name ="Qty" type ="xs:string" maxOccurs
>="unbounded"/>
> <xs:element name ="Time" type ="xs:string" maxOccurs
>="unbounded"/>
> <xs:sequence id ="Detail">
> <xs:element name ="Description" type ="xs:string" maxOccurs
>="unbounded"/>
> <xs:element name ="Price" type ="xs:string" maxOccurs
>="unbounded"/>
> </xs:sequence>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
></xs:schema>
>I have a tuesday deadline to get this data into my data base... can someone
>please give me a hand?
>I really appreciate whoever can take their time to help me... You have no
>idea how much I appreciate it!
>Aaron
|||Now that I have my schema and my xml file: Where do I go from here to
bulkload my Sql Dataase?
In over my head, lol
Aaron
Aaron C wrote:[vbcol=seagreen]
>I did find a schema generator: Would this be correct or is this wrong?
><?xml version="1.0" encoding="UTF-8"?>
><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
>elementFormDefault="qualified">
> <xs:element name="AvailableBatch">
> <xs:complexType>
> <xs:sequence>
> <xs:element ref="Date"/>
> <xs:element maxOccurs="unbounded" ref="Available"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="Date" type="xs:string"/>
> <xs:element name="Available">
> <xs:complexType>
> <xs:sequence>
> <xs:element ref="Sku"/>
> <xs:element ref="Part"/>
> <xs:element ref="Location"/>
> <xs:element ref="Qty"/>
> <xs:element ref="Time"/>
> <xs:element ref="Detail"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="Sku" type="xs:integer"/>
> <xs:element name="Part" type="xs:string"/>
> <xs:element name="Location" type="xs:integer"/>
> <xs:element name="Qty" type="xs:integer"/>
> <xs:element name="Time" type="xs:NMTOKEN"/>
> <xs:element name="Detail">
> <xs:complexType>
> <xs:sequence>
> <xs:element ref="Desc"/>
> <xs:element minOccurs="0" ref="Weight"/>
> <xs:element minOccurs="0" ref="Price"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="Desc" type="xs:string"/>
> <xs:element name="Weight" type="xs:decimal"/>
> <xs:element name="Price" type="xs:decimal"/>
></xs:schema>
>[quoted text clipped - 80 lines]
Message posted via http://www.droptable.com
|||You have to specify the annotations to describe the mapping between your Xml
and relatinal structures.
Check out this link:
http://msdn.microsoft.com/library/de...tions_0gqb.asp
Bertan ARI
This posting is provided "AS IS" with no warranties, and confers no rights.
"Aaron C via droptable.com" <forum@.droptable.com> wrote in message
news:52DF026D67AC8@.droptable.com...
> Now that I have my schema and my xml file: Where do I go from here to
> bulkload my Sql Dataase?
> In over my head, lol
> Aaron
>
> Aaron C wrote:
>
> --
> Message posted via http://www.droptable.com

No comments:

Post a Comment