Re: Help with XSD Schema

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

From: Vai2000 (nospam_at_microsoft.com)
Date: 03/25/04


Date: Thu, 25 Mar 2004 15:14:31 -0500

Thanks Steve,I had tried that out using the following snippet

StringReader sr=new StringReader(xmlDoc);

DataSet ds2 =new DataSet();

ds2.ReadXmlSchema(@"myschema.xsd");

ds2.ReadXml(sr);

GOT ERRORED OUT SAYING "Input string was not in a correct format."

:(

"Steve Alpert" <help@work.r.us> wrote in message
news:uTrdnFpEEHA.1228@TK2MSFTNGP11.phx.gbl...
> I'd expect you want to change:
>
> <xs:simpleContent msdata:ColumnName="item_Text" msdata:Ordinal="2">
> <xs:extension base="xs:string">
>
> to:
>
> <xs:simpleContent msdata:ColumnName="item_Text" msdata:Ordinal="2">
> <xs:extension base="xs:long">
> ^^^^^^^^
>
> /steveA
>
> Vai2000 wrote:
> > Hi all!!
> > This is my XML
> > <foo>
> > <item name="gold" carat="18">8987</item>
> > <item name="gold" carat="14">8907</item>
> > </foo>
> >
> > AND THIS WAS THE SCHEMA GENERATED VIA THE VS IDE
> > I want the item_Text to be INTEGER type as well as name to Code instead
of
> > item_Text !!! What changes are required in the schema for that?
> >
> > TIA
> > <?xml version="1.0" ?>
> >
> > <xs:schema id="foo" targetNamespace="http://tempuri.org/xsd_int.xsd"
> > xmlns:mstns="http://tempuri.org/xsd_int.xsd"
> > xmlns="http://tempuri.org/xsd_int.xsd"
> > xmlns:xs="http://www.w3.org/2001/XMLSchema"
> > xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
> > attributeFormDefault="qualified" elementFormDefault="qualified">
> >
> > <xs:element name="foo" msdata:IsDataSet="true"
> > msdata:EnforceConstraints="False">
> >
> > <xs:complexType>
> >
> > <xs:choice maxOccurs="unbounded">
> >
> > <xs:element name="item" nillable="true">
> >
> > <xs:complexType>
> >
> > <xs:simpleContent msdata:ColumnName="item_Text" msdata:Ordinal="2">
> >
> > <xs:extension base="xs:string">
> >
> > <xs:attribute name="name" form="unqualified" type="xs:string" />
> >
> > <xs:attribute name="carat" form="unqualified" type="xs:string" />
> >
> > </xs:extension>
> >
> > </xs:simpleContent>
> >
> > </xs:complexType>
> >
> > </xs:element>
> >
> > </xs:choice>
> >
> > </xs:complexType>
> >
> > </xs:element>
> >
> > </xs:schema>
> >
> >



Relevant Pages

  • need code snippet to verify input strings
    ... I'm obviously a newbie, and since I detest re-inventing the wheel, can ... someone show me/give me a snippet that will verify that an input string is ... I'm using DB2 and would like to verify that a string is ...
    (comp.lang.php)
  • Re: MultibyteToWideChar not working properly?
    ... course the input string is not UTF-7 formatted, ... it and return 0 saying that the string is not UTF-7. ... wanted the same result when passing ASCII-7 as input encoding ...
    (microsoft.public.vc.mfc)
  • Need help with Function declaration syntax!
    ... input string in a complex IF ELSE statement ... I tried making the selects into returns and saying it just returns a varchar ... What can I do to make it do all this and compile? ...
    (microsoft.public.sqlserver.programming)