D
David Elliott
Trying to figure out why my XML Namespace is changing. Here is a snip of the full XML
Before DataSet.ReadXmlSchema() -- this is from xmlDoc.OuterXml
<?xml version=\"1.0\" encoding=\"utf-16\"?>
<xs:schema id=\"GetDocumentSummary\"
xmlns=\"\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"
xmlns:msdata =\"urn:schemas-microsoft-com:xml-msdata\"
xmlns:codegen=\"urn:schemas-microsoft-com:xml-msprop\">
Output from DataSet.GetXmlSchema()
<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n
<xs:schema id=\"GetDocumentSummary\"
xmlns=\"\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"
xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\"
xmlns:msprop=\"urn:schemas-microsoft-com:xml-msprop\">\r\n
Note the last line in each of the examples above xmlns:codegen changed to xmlns:msprop.
Why?
Thanks,
Dave
Here is the code I am using
// this is defined and set elsewhere in the system
XmlDataDocument xmlDoc;
public DataSet Schema
{
get
{
DataSet ds = new DataSet();
MemoryStream ms = new MemoryStream(Encoding.Unicode.GetBytes(xmlDoc.OuterXml));
ms.Position = 0;
ds.ReadXmlSchema(ms);
return (ds);
}
}
Before DataSet.ReadXmlSchema() -- this is from xmlDoc.OuterXml
<?xml version=\"1.0\" encoding=\"utf-16\"?>
<xs:schema id=\"GetDocumentSummary\"
xmlns=\"\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"
xmlns:msdata =\"urn:schemas-microsoft-com:xml-msdata\"
xmlns:codegen=\"urn:schemas-microsoft-com:xml-msprop\">
Output from DataSet.GetXmlSchema()
<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n
<xs:schema id=\"GetDocumentSummary\"
xmlns=\"\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"
xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\"
xmlns:msprop=\"urn:schemas-microsoft-com:xml-msprop\">\r\n
Note the last line in each of the examples above xmlns:codegen changed to xmlns:msprop.
Why?
Thanks,
Dave
Here is the code I am using
// this is defined and set elsewhere in the system
XmlDataDocument xmlDoc;
public DataSet Schema
{
get
{
DataSet ds = new DataSet();
MemoryStream ms = new MemoryStream(Encoding.Unicode.GetBytes(xmlDoc.OuterXml));
ms.Position = 0;
ds.ReadXmlSchema(ms);
return (ds);
}
}