Re: How do you read an XML schema in SQL 2005
- From: "Mike C#" <xyz@xxxxxxx>
- Date: Wed, 30 Jan 2008 19:32:47 -0500
As I mentioned in the first response, to "integrate" these XML schemas into
your database, simply create XML Schema Collections. You do that with the
CREATE XML SCHEMA COLLECTION statement, the syntax and semantics of which
are in SQL Server Books Online. Once you've created an XML schema
collection, simply declare your XML variables/columns as "typed" instances,
like this:
DECLARE @x XML (my_xml_schema_collection);
CREATE TABLE my_table (x XML (my_xml_schema_collection) );
While you're in BOL, look up the XML data type and search for "typed XML".
"Dee" <Dee@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:395597BE-392D-42F5-BB9B-A0BA2F576F6E@xxxxxxxxxxxxxxxx
Joe,
I was given a bunch of schema's and told to incorporate them into our
database.
I have viewed the main schema in VS 2005.
Also I was given an XML file with this but it seems to be in a schema as
well.
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<us:SyncProductRelationship xmlns:us='http://www.ussco.com/oagis/0'
xmlns:oa='http://www.openapplications.org/oagis/9' releaseID="9.1"
systemEnvironmentCode="Production" languageCode="en-US" >
<oa:ApplicationArea>
<oa:Sender>
<oa:LogicalID>scsuqgis1</oa:LogicalID>
<oa:ComponentID>UNS_MDM_CONTENT_DRIVER</oa:ComponentID>
<oa:TaskID>Relationship14.xml</oa:TaskID>
<oa:ReferenceID>1961168</oa:ReferenceID>
</oa:Sender>
<oa:CreationDateTime>2007-12-06T23:53:47</oa:CreationDateTime>
</oa:ApplicationArea>
<us:DataArea>
<oa:Sync></oa:Sync>
<us:ProductRelationship>
<us:PrefixNumber>OFX</us:PrefixNumber>
<us:StockNumberButted>00023</us:StockNumberButted>
<us:Relationship>
Would like to know also is there a way to split xml files to make them
smaller?
Thanks
Dee
"Joe Fawcett" wrote:
"Dee" <Dee@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:55FB83CE-EF1C-4DE4-A19B-176C86007D3B@xxxxxxxxxxxxxxxx
From what I see my source may already be in a schema collection. If soWhat is your 'source'?
is
there doc on getting the information in the database? Here is a sample
of
what I have:
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2008 (http://www.altova.com) by United
Stationers
Supply Co. (United Stationers Supply Co.) -->
<!--
** OAGIS® Revision: 9.0 **
** Date: 08 April 2005 **
** Copyright 1998-2005, All Rights Reserved **
This is an OAGIS® BOD XML Schema (XSD) Definition.
License information for this file is provided in the file **2005 OAGi
License Agreement.txt** that is provided with this download package.
For support, more information, or to report implementation bugs, please
contact the Open Applications Group at xml@xxxxxxxxxxxxxxxxxxxxx
XML Schema
Name:
-->
<xsd:schema xmlns:oa="http://www.openapplications.org/oagis/9"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:us="http://www.ussco.com/oagis/0"
targetNamespace="http://www.ussco.com/oagis/0"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xsd:import namespace="http://www.openapplications.org/oagis/9"
schemaLocation="..\..\..\OAGIS-9_1-GA-070511-Schemas\oagis\9_1\Resources\Nouns\ItemMaster.xsd"/>
<xsd:include schemaLocation="..\Components\Common\Components.xsd"/>
<xsd:complexType name="ItemMasterType">
<xsd:sequence>
<xsd:element ref="us:ItemMasterHeader" minOccurs="0"/>
<xsd:element ref="us:ItemLocation" minOccurs="0"
maxOccurs="unbounded"/>
<xsd:element ref="us:GlobalItem" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="us:ReferenceItem" minOccurs="0"
maxOccurs="unbounded"/>
<xsd:element ref="us:ConsumerPricing" minOccurs="0"/>
<xsd:element ref="us:ItemList" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="us:Matchbook" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="us:WarrantyInfo" minOccurs="0"/>
<xsd:element ref="us:LineDrawing" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="ItemMaster" type="us:ItemMasterType"/>
<xsd:complexType name="GlobalItemType">
<xsd:sequence>
<xsd:element name="StartDate" type="oa:DateTimeType" minOccurs="0"/>
<xsd:element name="EndDate" type="oa:DateTimeType" minOccurs="0"/>
<xsd:element name="UprIncludeCode" type="oa:CodesType" minOccurs="0"/>
<xsd:element name="InventoryUnitCode" type="oa:UOMCodeType"
minOccurs="0">
<xsd:annotation>
<xsd:documentation>USSCO: Unitedâ?Ts inventory selling unit of measure.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="ItemWeight" type="oa:MeasureType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>USSCO: The item weight based on the selling unit of
measure. Weight values are reflected in single numbers in pounds with
3
decimal places to the right (x.xxx). Refer to the SHP_WGT_QTY for the
master
carton weight. Note: The item weight has been provided fo
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="GTINItem" minOccurs="0">
<xsd:annotation>
<xsd:documentation>USSCO: Used to identify trade items at various
packaging levels (item level)
</xsd:documentation>
Thank you
Dee
The code above is a schema, is this schema already part of an XML SCHEMA
COLLECTION?
Do you have any XML instances that you wish to validate or store that
conform to this schema?
What exactly do you want to do?
--
Joe Fawcett (MVP - XML)
http://joe.fawcett.name
.
- References:
- Re: How do you read an XML schema in SQL 2005
- From: Mike C#
- Re: How do you read an XML schema in SQL 2005
- From: Joe Fawcett
- Re: How do you read an XML schema in SQL 2005
- From: Dee
- Re: How do you read an XML schema in SQL 2005
- From: Joe Fawcett
- Re: How do you read an XML schema in SQL 2005
- From: Dee
- Re: How do you read an XML schema in SQL 2005
- Prev by Date: Re: How do you read an XML schema in SQL 2005
- Previous by thread: Re: How do you read an XML schema in SQL 2005
- Index(es):
Loading