J
Jeff
Hello!
IDE: VS 2003 .Net
OS: XP Pro
I'm experimenting with C# for the purpose to learn it... I've made a test
program that create a simple xml-file using XmlTextWriter. Now I want to
extend that logic so the xml-file references a xsd-file...
I know that if XmlTextWriter begin to write data to a xml-file that already
contains data, the contents is truncated, so everything must be created
again through the XmlTextWriter.
My problem is this:
How do I link a xsd-file to a xml-file using XmlTextWriter???
Here is some of the approaches I tryed:
XmlTextWriter writer = new XmlTextWriter(dlgOpen.FileName, null);
writer.WriteStartDocument();
writer.WriteDocType("Countries", null, "test.xsd", null);
writer.WriteStartElement("Countries");
// some computing
writer.WriteEndDocument();
When the resulting xml-file is displayed in IE, I get this error message
"The XML page cannot be displayed"
So this approach is wrong I guess!!
I've searched the internet (for 1 day) for clues about this, but so far
without any luck so far. Lot of info there about xml, but I found non that
explains my problem...
Any clues will be appreciated!
Regards!
Jeff
IDE: VS 2003 .Net
OS: XP Pro
I'm experimenting with C# for the purpose to learn it... I've made a test
program that create a simple xml-file using XmlTextWriter. Now I want to
extend that logic so the xml-file references a xsd-file...
I know that if XmlTextWriter begin to write data to a xml-file that already
contains data, the contents is truncated, so everything must be created
again through the XmlTextWriter.
My problem is this:
How do I link a xsd-file to a xml-file using XmlTextWriter???
Here is some of the approaches I tryed:
XmlTextWriter writer = new XmlTextWriter(dlgOpen.FileName, null);
writer.WriteStartDocument();
writer.WriteDocType("Countries", null, "test.xsd", null);
writer.WriteStartElement("Countries");
// some computing
writer.WriteEndDocument();
When the resulting xml-file is displayed in IE, I get this error message
"The XML page cannot be displayed"
So this approach is wrong I guess!!
I've searched the internet (for 1 day) for clues about this, but so far
without any luck so far. Lot of info there about xml, but I found non that
explains my problem...
Any clues will be appreciated!
Regards!
Jeff