RE: ReadXML and data types
- From: "Stephanie Olds" <bluecat@xxxxxxxxxxxxx>
- Date: Tue, 6 Sep 2005 08:35:32 -0700
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."
>
>
.
- Follow-Ups:
- RE: ReadXML and data types
- From: Kevin Yu [MSFT]
- RE: ReadXML and data types
- References:
- ReadXML and data types
- From: Stephanie Olds
- RE: ReadXML and data types
- From: Kevin Yu [MSFT]
- ReadXML and data types
- Prev by Date: dtd to data model
- Next by Date: Re: validating reader and entities
- Previous by thread: RE: ReadXML and data types
- Next by thread: RE: ReadXML and data types
- Index(es):
Relevant Pages
|