public void PrefixedTargetNS()
{
string xs = @"<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:msdata='urn:schemas-microsoft-com:xml-msdata' xmlns:x='urn:foo' targetNamespace='urn:foo' elementFormDefault='qualified'>
<xs:element name='DS' msdata:IsDataSet='true'>
<xs:complexType>
<xs:choice>
<xs:element ref='x:R1' />
<xs:element ref='x:R2' />
</xs:choice>
</xs:complexType>
<xs:key name='key'>
<xs:selector xpath='./any/string_is_OK/x:R1'/>
<xs:field xpath='x:Child2'/>
</xs:key>
<xs:keyref name='kref' refer='x:key'>
<xs:selector xpath='.//x:R2'/>
<xs:field xpath='x:Child2'/>
</xs:keyref>
</xs:element>
<xs:element name='R3' type='x:RootType' />
<xs:complexType name='extracted'>
<xs:choice>
<xs:element ref='x:R1' />
<xs:element ref='x:R2' />
</xs:choice>
</xs:complexType>
<xs:element name='R1' type='x:RootType'>
<xs:unique name='Rkey'>
<xs:selector xpath='.//x:Child1'/>
<xs:field xpath='.'/>
</xs:unique>
<xs:keyref name='Rkref' refer='x:Rkey'>
<xs:selector xpath='.//x:Child2'/>
<xs:field xpath='.'/>
</xs:keyref>
</xs:element>
<xs:element name='R2' type='x:RootType'>
</xs:element>
<xs:complexType name='RootType'>
<xs:choice>
<xs:element name='Child1' type='xs:string'>
</xs:element>
<xs:element name='Child2' type='xs:string' />
</xs:choice>
<xs:attribute name='Attr' type='xs:integer' />
</xs:complexType>
</xs:schema>";
// No prefixes on tables and columns
var ds = new DataSet();
ds.Tables.Add(new DataTable("R3"));
ds.Tables[0].ReadXmlSchema(new StringReader(xs));
DataTable dt = ds.Tables[0];
AssertDataTable("R3", dt, "R3", 3, 0, 0, 0, 0, 0);
AssertDataColumn("col1", dt.Columns[0], "Attr", true, false, 0, 1, "Attr", MappingType.Attribute, typeof(long), DBNull.Value, string.Empty, -1, string.Empty, 0, string.Empty, false, false);
}