Class Element
The internal representation of an actual element (not an element type). An Element has an element type, attributes, and a successor Element for use in constructing stacks and queues of Elements.
Inheritance
Inherited Members
Namespace: TagSoup
Assembly: Lucene.Net.Benchmark.dll
Syntax
public class Element
Constructors
| Improve this Doc View SourceElement(ElementType, Boolean)
Return an Element from a specified ElementType.
Declaration
public Element(ElementType type, bool defaultAttributes)
Parameters
| Type | Name | Description |
|---|---|---|
| ElementType | type | The element type of the newly constructed element |
| System.Boolean | defaultAttributes | True if default attributes are wanted |
Properties
| Improve this Doc View SourceAttributes
Gets the attributes as an Attributes object. Returning an Attributes makes the attributes mutable.
Declaration
public virtual Attributes Attributes { get; }
Property Value
| Type | Description |
|---|---|
| Attributes |
See Also
| Improve this Doc View SourceFlags
Gets the flags vector of the element's type.
Declaration
public virtual int Flags { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
IsPreclosed
Return true if this element has been preclosed.
Declaration
public virtual bool IsPreclosed { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
LocalName
Gets the local name of the element's type.
Declaration
public virtual string LocalName { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
MemberOf
Gets the member-of vector of the element's type.
Declaration
public virtual int MemberOf { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Model
Gets the content model vector of the element's type.
Declaration
public virtual int Model { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Name
Gets the name of the element's type.
Declaration
public virtual string Name { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Namespace
Gets the namespace name of the element's type.
Declaration
public virtual string Namespace { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Next
Gets or sets the next element in an element stack or queue.
Declaration
public virtual Element Next { get; set; }
Property Value
| Type | Description |
|---|---|
| Element |
Parent
Gets the parent element type of the element's type.
Declaration
public virtual ElementType Parent { get; }
Property Value
| Type | Description |
|---|---|
| ElementType |
Type
Gets the element type.
Declaration
public virtual ElementType Type { get; }
Property Value
| Type | Description |
|---|---|
| ElementType |
Methods
| Improve this Doc View SourceAnonymize()
Make this element anonymous.
Remove any id or name attribute present
in the element's attributes.
Declaration
public virtual void Anonymize()
CanContain(Element)
Return true if the type of this element can contain the type of another element. Convenience method.
Declaration
public virtual bool CanContain(Element other)
Parameters
| Type | Name | Description |
|---|---|---|
| Element | other | The other element |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Clean()
Clean the attributes of this element. Attributes with null name (the name was ill-formed) or null value (the attribute was present in the element type but not in this actual element) are removed.
Declaration
public virtual void Clean()
Preclose()
Force this element to preclosed status, meaning that an end-tag has been seen but the element cannot yet be closed for structural reasons.
Declaration
public virtual void Preclose()
SetAttribute(String, String, String)
Set an attribute and its value into this element.
Declaration
public virtual void SetAttribute(string name, string type, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The attribute name (Qname) |
| System.String | type | The attribute type |
| System.String | value | The attribute value |