F
fmancina
Hi,
I am employing the XmlTextWriter class to generate an XML document.
Everything works fine, until I have to write an attribute to an element
which contains a value.
Examples below:
// <Author>Frank</Author>
// is equivalent to
writer.WriteElementString("Author","Frank");
// <Font ss:FontName="Verdana" ss:Size="12" ss:Bold="1"/>
// is equivalent to
writer.WriteStartElement("Font");
writer.WriteAttributeString("ss:FontName", "Verdana");
writer.WriteAttributeString("ss:Size", "12");
writer.WriteAttributeString("ss:Bold", "1");
writer.WriteEndElement();
However, if I wanted to do this:
//<Data ss:Type="String">sample data</Data>
I cannot.
Does anyone know if there is a way to write attributes on elements that
contain a string value?
Thanks for any help,
Frank
I am employing the XmlTextWriter class to generate an XML document.
Everything works fine, until I have to write an attribute to an element
which contains a value.
Examples below:
// <Author>Frank</Author>
// is equivalent to
writer.WriteElementString("Author","Frank");
// <Font ss:FontName="Verdana" ss:Size="12" ss:Bold="1"/>
// is equivalent to
writer.WriteStartElement("Font");
writer.WriteAttributeString("ss:FontName", "Verdana");
writer.WriteAttributeString("ss:Size", "12");
writer.WriteAttributeString("ss:Bold", "1");
writer.WriteEndElement();
However, if I wanted to do this:
//<Data ss:Type="String">sample data</Data>
I cannot.
Does anyone know if there is a way to write attributes on elements that
contain a string value?
Thanks for any help,
Frank