help with user types in schemas.

G

Guest

I have an xml file where the top level units have the form

<a>
<a1>1</a1>
<a2>1</a2>
<a2>2</a2>
</a>
where there can be any number of <a2> elements (at least one) in each <a>
element. This should generate a two table data set with an "a" table and an
"a2" table. If I declare a2 to have minoccurs 1 and maxoccurs unbound and
type xs:double that is exactly what I get. However, ... I can create a user
type posDouble and declare it to have a base of double, a minexclusive of 0.
If I now declare a2 to be type posDouble, my dataset loses the a2 table.
All I can see is a single a2 column with one value in it! This shouldn't
happen! Help!

I've tried endless permutations without success. For, example if I use the
"create schema" functionality of the xml file, I get

<xs:element name="a2" minoccurs ="0" maxoccurs ="unbounded" nillable ="true">
<xs:complexType>
<xs:simpleContent msdata:ColumnName="a2_Text" msdata:Ordinal="0">
<xs:extension base="xs:string"></xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>

Althought the help files say that simpleContent should take xs:restriction
in place of xs:extension, putting it in creates errors when "Generate
Dataset" is checked.

This should be trivial. What's the answer?
 
C

Cor Ligthert [MVP]

Rossu,

I am not sure if I understand your question. However, probably is the answer
that you cannot use complex datatypes in a DataSet. The most what reaches
that is the Nested XML file. Search for that "Nested DataSet" yourself on
MSDN. With that search string because it is very hard to find it there.

I hope this helps something,

Cor
 
G

Guest

If I understand correctly you are saying I can't use anything that doesn't
translate to an intrinsic .NET type

PosInteger is ok because it maps to Uint64
PosDouble (i.e. double with a restiriction of xs:mininclusive:0) is not ok
because it won't map to an intrinsic .NET type

the xml schema is happy with the PosDouble case, (i.e. it is legal xml for a
schema), but it can't be translated into a typed dataset.
 
C

Cor Ligthert [MVP]

Rossu,

If it is about datatypes, than you can AFAIK use those which are as well
available in a standard SQL type database server.

I hope this helps,

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top