Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to insert XSD tag data

Status
Not open for further replies.

pabowen

Programmer
Nov 6, 2002
95
US
I hope my subject was correct. I am very new to this. I am exporting out data and have a requirement to match a customers schema. Using C# I have been able to create the beginning of an XML document.

So far the content of my document looks like this:

<?xml version="1.0" encoding="utf-8" ?>
<Course_Master />

(I am currently not populating any data)
I need it to look like this:

<?xml version="1.0" encoding="utf-8" ?>
<COURSE_MASTER xmlns=" xmlns:xsi=" xsi:noNamespaceSchemaLocation="\\nat001lms\c$\My Doc\COURSE_MASTER.xsd">

The code I have written in C# currently looks like this.
Code:
writer.WriteStartDocument();
writer.WriteStartElement("Course_Master");
//future Logic for populating records placed here
	{
	}
writer.WriteEndElement();
writer.Flush();
writer.Close();
I understand that this info has to do with the XSD information, but I don't know enough about that yet.

Do I need to reference the XSD first and that will bring in this tag, and if so is that how I enforce the schema and how do I do it?

Any help would be greatly appreciated, or even a point towards a good online reference.

Thanks,
Patrick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top