I'm getting this error 'Undefined data type: 'token'' on the second line of this VS2005 VB code:
Dim _ds As New DataSet
_ds.ReadXmlSchema("long path to.xsd")
The xsd I'm trying to read has 3 files, 2 imports. It looks like this:_ds.ReadXmlSchema("long path to.xsd")
transcript <-- academic record <-- core
The only place in the 3 files I find 'token' is in the core.xsd file. One of 2 occurrences looks like this:
<xs:simpleType name="StateProvinceCodeType">
<xs:annotation>
<xs:documentation>Code for US states, etc., and Canadian provinces:
AA Military-Americas
AB Alberta
...
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:token">
<xs:enumeration value="AA">
<xs:annotation>
<xs:documentation>MILITARY-AMERICAS</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="AB">
<xs:annotation>
<xs:documentation>ALBERTA</xs:documentation>
</xs:annotation>
</xs:enumeration>
...
</xs:restriction>
</xs:simpleType>
I think I know what the committee was trying to do with this schema segment. Maybe VS2K5 doesn't implement this 'token' construct.
Does anyone know of a workaround to this problem
Thanks.

Undefined data type: 'token'
SDLacey
Before I devote too much time to another dead end, can I feed the output of this transform into a datadocument or directly into a dataset
fuul
It's not very easy. Unfortunately.< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
XmlDataDovument and DataSet can be loaded from XmlReader while XslCompiledTransform produces XML in form of XmlWriter.
The simplest solution is to write result of transformation into file or string and then load it to DataSet.
If perf is critical to your app you can use XslReader class.
The best approach would be develop XmlDataSetAddapter that can load DataSet directly from XmlWriter, but I never hared about such thing.
Josh D
Yes, you are able to read the output of the transform into another document.
--VV [MS]
vascov@microsoft.com
Sigura
If you change xs:token to xs:string, it should work.
--VV [MS]
vascov@microsoft.com