"Terrance" <Terrance@discussions.microsoft.comwrote in message
news:83F18E3D-DBF4-4893-8D2F-C1D0BD0E3C42@microsoft.com...
Good Morning. I'm trying to create a xml file and schema file for my boss
to
upload the information into Sharepoint. Everytime when he uploads the xml
file it notices there's no schema and I'm automatically generating the
file;
so I decided to programmatically create a schema file. It's a simple file
and it's works accept for the last elements . Instead of writing
</xsd:elementand </xsd:schemait places the namespace in the schema tag
and name attribute in the element closing tag. I've tried
xmlTextWriter.WriteRaw and .WriteString but it doesn't indent correctly.
How
can I get these tags to be generated as I described earlier? Below is the
code (xsdWriter is XmlTextWriter object):
I think what you're looking for is the WriteAttributeString statement. You
can use Google and look it up. But as I recalled, that is how you control
name spaces on closing tags.
writer.WriteStartElement("track");
writer.WriteAttributeString("name", "Street Spirit");
writer.WriteEndElement();