BCL mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ] 1.0.5000.0 2.0.0.0 4.0.0.0 All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe. System.Object System.Runtime.InteropServices.ComVisible(true)

This class is intended to be a lightweight implementation of a simple XML object model for use within the security system, and not for use as a general XML object model. This documentation assumes a basic knowledge of XML.

The simple XML object model for an element consists of the following parts:

The tag is the element name.

The attributes are zero or more name/value attribute pairs on the element.

The children are zero or more elements nested within <tag> and </tag>.

It is strongly suggested that attribute based XML representation is used to express security elements and their values. This means properties of an element are expressed as attributes and property values are expressed as attribute values. Avoid nesting text within tags. For any <tag>text</tag> representation a representation of type <tag value="text"/> is usually available. Using this attribute-based XML representation increases readability and allows easy WMI portability of the resulting XML serialization.

An attribute name must be one character or longer, and cannot be null. If element-based value representation is used, elements with a text string that is null are represented in the <tag/> form; otherwise, text is delimited by the <tag> and </tag> tokens. Both forms can be combined with attributes, which are shown if present.

The tags, attributes, and text of elements, if present, are always case-sensitive. The XML form contains quotations and escapes where necessary. String values that include characters invalid for use in XML result in an . These rules apply to all properties and methods.

For performance reasons, character validity is only checked when the element is encoded into XML text form, and not on every set of a property or method. Static methods allow explicit checking where needed.

Represents the XML object model for encoding security objects. This class cannot be inherited.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  The parameter must consist of a valid XML tag name. Use to remove invalid characters from the string.

  Initializes a new instance of the class with the specified tag.

  The tag name of an XML element.
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  If the parameter is null this constructor produces an element identical to the default constructor.

  Initializes a new instance of the class with the specified tag and text.

  The tag name of the XML element.
  The text content within the element.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void `` ``

  Names and values in attributes should only contain valid XML attribute characters. XML attribute names must be unique. Use to remove invalid characters from the string.

  There is no support for quoted strings, so strings for name/value pairs should not contain quotes or other characters requiring quoting.

  Adds a name/value attribute to an XML element.

  The name of the attribute. The value of the attribute.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void ``

  The child element is added following any previously existing child elements.

  Adds a child element to the XML element.

  The child element to add.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String ``

  With XML as follows, Attribute("B") would return "456".

  `<thetag A="123" B="456" C="789">text</thetag>`

  Finds an attribute by name in an XML element.

  The value associated with the named attribute, or null if no attribute with exists.

  The name of the attribute for which to search.
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Collections.Hashtable To be added.

  Each attribute is stored in the as a name/value pair.

  Names and values in attributes should contain only valid XML attribute characters. Use to remove invalid characters from the string.

  There is no support for quoted strings, so strings for name/value pairs should not contain quotes or other characters requiring quoting.

  Gets or sets the attributes of an XML element as name/value pairs.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Collections.ArrayList To be added.

  If a contains both and , will appear first.

  Gets or sets the array of child elements of the XML element.

- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Security.SecurityElement

  The copy includes both the and properties.

  Creates and returns an identical copy of the current object.

  A copy of the current object.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean ``

  If there are child elements, comparison extends recursively to them.

  There is no support for comparing different XML representations of the same characters.

  Compares two XML element objects for equality.

  true if the tag, attribute names and values, child elements, and text fields in the current XML element are identical to their counterparts in the parameter; otherwise, false.

  An XML element object to which to compare the current XML element object.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String ``

  Use this method to replace invalid characters in a string before using the string in a . If invalid characters are used in a without being escaped, an is thrown.

  The following table shows the invalid XML characters and their escaped equivalents.

  invalid XML Character

  Replaced With

  "<"

  "&lt;"

  ">"

  "&gt;"

  "\""

  "&quot;"

  "\'"

  "&apos;"

  "&"

  "&amp;"

  Replaces invalid XML characters in a string with their valid XML equivalent.

  The input string with invalid characters replaced.

  The string within which to escape invalid characters.
- Method
  2.0.0.0
  4.0.0.0
  System.Security.SecurityElement ``

  Do not use single quotation marks in the XML string; instead, use escaped double quotation marks. For example, instead of "<value name='Company'>Microsoft</value>" use "<value name=\"Company\">Microsoft</value>".

  Using single quotation marks can result in either an exception being thrown or, in some cases, the single quotation marks being treated as text in the string.

  Creates a security element from an XML-encoded string.

  A created from the XML.

  The XML-encoded string from which to create the security element.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean ``

  This method can be used to test an attribute before adding it to a security element.

  Determines whether a string is a valid attribute name.

  true if the parameter is a valid XML attribute name; otherwise, false.

  The attribute name to test for validity.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean ``

  This method can be used to test an attribute before adding it to a security element.

  Determines whether a string is a valid attribute value.

  true if the parameter is a valid XML attribute value; otherwise, false.

  The attribute value to test for validity.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean ``

  This can be used to test a before setting it.

  Determines whether a string is a valid tag.

  true if the parameter is a valid XML tag; otherwise, false.

  The tag to test for validity.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean ``

  This method can be used to test before setting it.

  Determines whether a string is valid as text within an XML element.

  true if the parameter is a valid XML text element; otherwise, false.

  The text to test for validity.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Security.SecurityElement ``

  With XML as follows, SearchForChildByTag("second") would return the child element <second>.

  `<thetag A="123" B="456" C="789"> <first>text1</first> <second>text2</second></thetag>`

  Finds a child by its tag name.

  The first child XML element with the specified tag value, or null if no child element with exists.

  The tag for which to search in child elements.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String ``

  This method is equivalent to the following:

  code reference: System.Security.SecurityElement#1

  With XML as follows, SearchForTextOfTag("second") would return "text2".

  `<thetag A="123" B="456" C="789"> <first>text1</first> <second>text2</second></thetag>`

  Finds a child by its tag name and returns the contained text.

  The text contents of the first child element with the specified tag value.

  The tag for which to search in child elements.
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String To be added.

  In XML, the tag appears in the script as appears below:

  `<tag attributes>text</tag>`

  If this element has child elements, the children will replace text.

  Assign only valid XML tag strings to this property. Use to remove invalid characters from the string.

  Gets or sets the tag name of an XML element.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String To be added.

  The text should not contain XML special characters. Use to remove invalid characters from the string.

  If a contains both and , will appear first.

  Gets or sets the text within an XML element.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String

  This method is useful in debugging to see the XML representation of the element.

  Produces a string representation of an XML element and its constituent attributes, child elements, and text.

  The XML element and its contents.

  0
0