Definition
Assembly: CloudNimble.XmlEssentials.dll Namespace: CloudNimble.Text.Xml.Serialization Inheritance: System.AttributeSyntax
Summary
Specifies that a member is serialized as the text content of the element for its containing type, written as a CDATA section. This class cannot be inherited.Usage
Put[XmlCData] on a member to make it the text of its containing element, written as a CDATA section. A CDATA section holds characters such as < and & without escaping, which keeps embedded code or markup readable.
Code is the content of <Script>. The other members of the type are attributes.
View the complete sample on GitHub
Remarks
The member must have a simple type: a type with a built-in value converter, an enumeration, or the nullable form of either. A type can map one member with this attribute or XmlTextAttribute, and that type cannot also map members to child elements.Considerations
[XmlCData]follows the rules of[XmlText]. A type can have one member with either attribute, and it can’t also have members mapped to child elements. The serializer throwsNotSupportedExceptionotherwise.- The member must have a simple type: a type with a built-in value converter, an enumeration, or the nullable form of either.
- The attribute affects writing only. When reading, escaped text and CDATA sections are accepted alike, so
<Script>a < b</Script>gives the same value as the CDATA form. - A value that contains
]]>is split at each]]>and written as several sections:a]]>bis written as<![CDATA[a]]]]><![CDATA[>b]]>. A reader joins them again, and the value reads back as it was. - A
nullvalue writes no content, which leaves the element empty. - CDATA is a way of writing text, not a different kind of data. A consumer that parses the document sees the same characters either way.
Constructors
.ctor
Syntax
.ctor Inherited
Inherited from
System.AttributeSyntax
.ctor Inherited
Inherited from
objectSyntax
Properties
TypeId Inherited Virtual
Inherited from
System.AttributeSyntax
Property Value
Type:object
Methods
Equals Override
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
Equals Inherited Virtual
Inherited from
objectSyntax
Parameters
Returns
Type:bool
Equals Inherited
Inherited from
objectSyntax
Parameters
Returns
Type:bool
GetCustomAttribute Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute?
GetCustomAttribute Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute?
GetCustomAttribute Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute?
GetCustomAttribute Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute?
GetCustomAttribute Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute?
GetCustomAttribute Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute?
GetCustomAttribute Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute?
GetCustomAttribute Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute?
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetCustomAttributes Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:System.Attribute[]
GetHashCode Override
Inherited from
System.AttributeSyntax
Returns
Type:int
GetHashCode Inherited Virtual
Inherited from
objectSyntax
Returns
Type:int
GetType Inherited
Inherited from
objectSyntax
Returns
Type:System.Type
IsDefaultAttribute Inherited Virtual
Inherited from
System.AttributeSyntax
Returns
Type:bool
IsDefined Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
IsDefined Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
IsDefined Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
IsDefined Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
IsDefined Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
IsDefined Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
IsDefined Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
IsDefined Inherited
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
Match Inherited Virtual
Inherited from
System.AttributeSyntax
Parameters
Returns
Type:bool
MemberwiseClone Inherited
Inherited from
objectSyntax
Returns
Type:object
ReferenceEquals Inherited
Inherited from
objectSyntax
Parameters
Returns
Type:bool
ToString Inherited Virtual
Inherited from
objectSyntax
Returns
Type:string?
Related APIs
- CloudNimble.Text.Xml.Serialization.XmlTextAttribute
- CloudNimble.Text.Xml.Serialization.XmlAttributeAttribute
- CloudNimble.Text.Xml.Serialization.XmlMixedAttribute
- CloudNimble.Text.Xml.Utf8XmlWriter