Writing xml:space and xml:lang Attributes

The WriteAttributeString method can also be used to write the special XML attributes xml:space and xml:lang. The xml:space attribute determines how white space should be handled within an element's scope. The xml:space attribute has only two possible values: preserve and default. default signals that the parse's white-space processing mode is acceptable for this element. preserve means that all the white space in the element's scope, significant or insignificant, should be preserved. When setting the value of the xml:space attribute, the XmlTextWriter will verifiy that the value is equal to one of the two strings. If it isn't, a System.InvalidOperationException is raised.

The xml:lang attribute specifies ...

Get Microsoft® .NET Compact Framework Kick Start now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.