RE: ReadXML and data types

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Kevin,
Thanks for the detailed response -- this was very helpful and my app worked
much better! (Now I just need the 211 to be $2.11, not $211.00, but I'll
work on that.)

If I want to put the schema in a separate XSD file, how do I associate this
with my XML file for ReadXml to use? (I assume I'll have to have some lines
referencing this XSD file in my XML file.) Also, can I have one XSD for
multiple XMLs that have the same format?
--
Stephanie Olds
Retail Professional Services
NCR Corporation


"Kevin Yu [MSFT]" wrote:

> Hi Stephanie,
>
> First of all, I would like to confirm my understanding of your issue. From
> your description, I understand that you need to make a column in a DataSet
> Xml Int type. If there is any misunderstanding, please feel free to let me
> know.
>
> To achieve this, you cannot simply add an attribute to the element in Xml,
> we have to add an inline schema. Here is an example.
>
> <?xml version="1.0" standalone="yes"?>
> <DocElement>
> <xs:schema id="DocElement" xmlns=""
> xmlns:xs="http://www.w3.org/2001/XMLSchema";
> xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
> <xs:element name="DocElement" msdata:IsDataSet="true";>
> <xs:complexType>
> <xs:choice maxOccurs="unbounded">
> <xs:element name="Table1">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="Col1" type="xs:string" minOccurs="0" />
> <xs:element name="Col2" type="xs:string" minOccurs="0" />
> <xs:element name="Col3" type="xs:string" minOccurs="0" />
> <xs:element name="Col4" type="xs:string" minOccurs="0" />
> <xs:element name="Col5" type="xs:string" minOccurs="0" />
> <xs:element name="Col6" type="xs:string" minOccurs="0" />
> <xs:element name="Col7" type="xs:int" minOccurs="0" />
> <xs:element name="Col8" type="xs:int" minOccurs="0" />
> <xs:element name="Col9" type="xs:string" minOccurs="0" />
> <xs:element name="Col10" type="xs:string" minOccurs="0" />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:choice>
> </xs:complexType>
> </xs:element>
> </xs:schema>
> <Table1>
> <Col1>2</Col1>
> <Col2>346</Col2>
> <Col3>501</Col3>
> <Col4>09/01/2005</Col4>
> <Col5>09:51:19</Col5>
> <Col6>123456789</Col6>
> <Col7>211</Col7>
> <Col8>211</Col8>
> <Col9>File1.tif</Col9>
> <Col10>File2.tif</Col10>
> </Table1>
> </DocElement>
>
> You can also seperate the schema into another .xsd file, if you don't want
> to put the schema in the xml file.
>
> HTH.
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>
>
.



Relevant Pages

  • Re: How to associate XML with XSD
    ... "MyDefaultNamespace" is usually a string that looks like a ... that my XML file has an associated XSD file? ... the schema of app.config files even though the text of the app.config file ...
    (microsoft.public.dotnet.xml)
  • Re: Importing existing XSD schema file into Visual Studio 2005
    ... XML file based on that schema? ... I've been given an XSD file by a 3rd party. ... there are tools in VS.NET to generate the typed DataSet classes ...
    (microsoft.public.dotnet.xml)
  • Xerces-C++ Schema validation
    ... I'm looking for a way of validating/parsing the xsd file (schema), ... only been able of validating the xml file with the corresponding ... schema, but what i want is only validate the xsd file, to check if the ...
    (comp.text.xml)
  • RE: SQLXMLBulkLoad and Keys
    ... and this hierarchy is not represented in the schema. ... For me it is easier to see it with all the indentations: ... > I've created a DTS package to bulk import an XML file into SQL Server ... > in the XSD file having something to do with the Sales_Price_Info key ...
    (microsoft.public.sqlserver.xml)
  • Re: How to use FindBy in typed DataSet?
    ... It is called from with Visual Studio when you save a XSD file. ... code generation to examine the schema and create the appropriate code. ... compile time, greatly reducing the possibility of errors in assigning ...
    (microsoft.public.dotnet.framework.windowsforms.controls)