O'Reilly logo

Microsoft® .NET Compact Framework Kick Start by Ronnie Yates, Erik Rubin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing XML Attributes

In this section we examine how to write attributes on elements. We also look at declaring namespace prefixes and creating the xml:space and xml:lang attributes.

Just like elements, attributes can be constructed piece by piece or written all at once. Writing attributes piece by piece is similar to writing an element piece by piece. The WriteStartAttribute and WriteEndAttribute methods provide this functionality.

WriteStartAttribute writes the start of an attribute, “name=”, or a start attribute with an optional user-defined namespace prefix, “prefix:name=”. WriteStartAttribute needs to be followed by a call to some method that will write the content of the attribute. The WriteEndAttribute method should be called after writing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required