Wednesday, March 7, 2012

How to do with xml file -> schema file (funcion in . NET)

I use a BulkLoad to import file.xml to my base MS Server 2000.
To import this xml file I need schema file. Mayby you know how to do this
file mechanicy f.g. mayby somebody have some script in .net who generate
this schema.
for any help Thanks
======== My xml file =================================
<ROOT>
<Customers>
<CustomerId>5555</CustomerId>
<CompanyName>Jagoda1</CompanyName>
<City>NY</City>
</Customers>
<Customers>
<CustomerId>0200</CustomerId>
<CompanyName>Tom Johnston</CompanyName>
<City>LA</City>
</Customers>
<Customers>
<CustomerId>199</CustomerId>
<CompanyName>Institute of Art</CompanyName>
</Customers>
</ROOT>
=================================================
My schema . How to do this schema mechanicy? Becouse in this time I must do
this schema ofcourse writing.
============================== MY Schema file ===============
<?xml version="1.0" ?>
<Schema xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:dt="urn:schemas-microsoft-com:xml:datatypes"
xmlns:sql="urn:schemas-microsoft-com:xml-sql" >
<ElementType name="CustomerId" dt:type="int" />
<ElementType name="CompanyName" dt:type="string" />
<ElementType name="City" dt:type="string" />
<ElementType name="ROOT" sql:is-constant="1">
<element type="Customers" />
</ElementType>
<ElementType name="Customers" sql:relation="Customer">
<element type="CustomerId" sql:field="CustomerId" />
<element type="CompanyName" sql:field="CompanyName" />
<element type="City" sql:field="City" />
</ElementType>
</Schema>
================================================== ======
Do you have any idea ?
Sorry for my english
Luk
ljag@.wp.pl
Hi
couple of options:
1. http://apps.gotdotnet.com/xmltools/xsdinference/
2. look at the (Select) 'FOR XML' options with SQL Srvr (some options can
gen schema)
3. if you don't have VS.NET, probably your best (freebie) is XML Fox
(XML/XSD Editor). (Only 1 I could find that would actually load in the XML
files I work with most of the time. (30+ MB) This includes DreamWeaver,
VS.NET, Eclipse, JBuilder, etc.)
4. if you have VS.NET, open your XML file and there's a 'create Schema'
option, under the XML Menu option
Rob
"Szaki" wrote:

> I use a BulkLoad to import file.xml to my base MS Server 2000.
> To import this xml file I need schema file. Mayby you know how to do this
> file mechanicy f.g. mayby somebody have some script in .net who generate
> this schema.
> for any help Thanks
> ======== My xml file =================================
> <ROOT>
> <Customers>
> <CustomerId>5555</CustomerId>
> <CompanyName>Jagoda1</CompanyName>
> <City>NY</City>
> </Customers>
> <Customers>
> <CustomerId>0200</CustomerId>
> <CompanyName>Tom Johnston</CompanyName>
> <City>LA</City>
> </Customers>
> <Customers>
> <CustomerId>199</CustomerId>
> <CompanyName>Institute of Art</CompanyName>
> </Customers>
> </ROOT>
> =================================================
> My schema . How to do this schema mechanicy? Becouse in this time I must do
> this schema ofcourse writing.
> ============================== MY Schema file ===============
> <?xml version="1.0" ?>
> <Schema xmlns="urn:schemas-microsoft-com:xml-data"
> xmlns:dt="urn:schemas-microsoft-com:xml:datatypes"
> xmlns:sql="urn:schemas-microsoft-com:xml-sql" >
> <ElementType name="CustomerId" dt:type="int" />
> <ElementType name="CompanyName" dt:type="string" />
> <ElementType name="City" dt:type="string" />
> <ElementType name="ROOT" sql:is-constant="1">
> <element type="Customers" />
> </ElementType>
> <ElementType name="Customers" sql:relation="Customer">
> <element type="CustomerId" sql:field="CustomerId" />
> <element type="CompanyName" sql:field="CompanyName" />
> <element type="City" sql:field="City" />
> </ElementType>
> </Schema>
> ================================================== ======
>
> Do you have any idea ?
> Sorry for my english
> --
> Luk
> ljag@.wp.pl
>
>
|||Thanks
Uytkownik "RobKaratzas" <RobKaratzas@.discussions.microsoft.com> napisa w
wiadomoci news:A489D834-8451-4E04-B489-FEFACB3E6CEB@.microsoft.com...[vbcol=seagreen]
> Hi
> couple of options:
> 1. http://apps.gotdotnet.com/xmltools/xsdinference/
> 2. look at the (Select) 'FOR XML' options with SQL Srvr (some options can
> gen schema)
> 3. if you don't have VS.NET, probably your best (freebie) is XML Fox
> (XML/XSD Editor). (Only 1 I could find that would actually load in the XML
> files I work with most of the time. (30+ MB) This includes DreamWeaver,
> VS.NET, Eclipse, JBuilder, etc.)
> 4. if you have VS.NET, open your XML file and there's a 'create Schema'
> option, under the XML Menu option
> Rob
> "Szaki" wrote:
this[vbcol=seagreen]
do[vbcol=seagreen]

No comments:

Post a Comment