XMLSchema - Adding undesired namespace
My Schema is as follows:
<?xml version="1.0" encoding="utf-16"?>
<xsd:schema xmlns:ms="urn:schemas-microsoft-com:xml-data" xmlns:sql="urn:schemas-microsoft-com:mapping-schema"
xmlns:dt="urn:schemas-microsoft-com:datatypes"
elementFormDefault="qualified" targetNamespace="myform" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:annotation>
<xsd:appinfo>
<sql:relationship name="Relationship1" parent="ParentTable" parent-key="id" child="ChildTable1" child-key="id" />
<sql:relationship name="Relationship2" parent="ParentTable" parent-key="id" child="ChildTable2" child-key="id" />
</xsd:appinfo>
</xsd:annotation>
.
.
.
After a xmlSchema.read, followed by a xmlSchema.write, the schema is changed to the following:
<?xml version="1.0" encoding="utf-16"?>
<xsd:schema xmlns:ms="urn:schemas-microsoft-com:xml-data" xmlns:sql="urn:schemas-microsoft-com:mapping-schema"
xmlns:dt="urn:schemas-microsoft-com:datatypes"
elementFormDefault="qualified" targetNamespace="myform" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:annotation>
<xsd:appinfo>
<sql:relationship name="Relationship1" parent="ParentTable" parent-key="id" child="ChildTable1" child-key="id"xmlns:sql="urn:schemas-microsoft-com:mapping-schema"/>
<sql:relationship name="Relationship2" parent="ParentTable" parent-key="id" child="ChildTable2" child-key="id" />
</xsd:appinfo>
</xsd:annotation>
This only happens on the first line of the annotation. It causes an error later on in my program when usingSqlXmlCommand.ExecuteXmlReader with the error:
Schema: unknown attribute 'sql' on relationship tag.

