ZPT-Sharp
v1.0.0
Zope Page Templates for .NET
|
Interface for a type which wraps a DOM element. More...
Public Member Functions | |
ISourceInfo | GetSourceInfo () |
Gets information about the source of the current element. More... | |
string | ToString () |
Returns a System.String that represents the current IZptElement. More... | |
IZptElement | ReplaceWith (IZptElement replacement) |
Replaces the current element in its respective DOM with the given replacement. More... | |
IZptElement[] | ReplaceWith (string content, bool interpretContentAsStructure) |
Replaces the current element instance with the given content. More... | |
void | ReplaceChildrenWith (string content, bool interpretContentAsStructure) |
Removes all children of the current element instance and replaces them with the given content. More... | |
IZptElement | InsertBefore (IZptElement existing, IZptElement newChild) |
Inserts a new child element into the current element's child elements. The new child will be the previous sibling before a given existing child. More... | |
IZptElement | InsertAfter (IZptElement existing, IZptElement newChild) |
Inserts a new child element into the current element's child elements. The new child will be the next sibling after a given existing child. More... | |
IZptElement | GetParentElement () |
Gets the element which is the parent of the current instance. More... | |
IZptElement[] | GetElementChain () |
Gets an ordered element chain, starting with the current element and including all of its parent elements from closest to furthest ancestors. More... | |
IZptElement[] | GetChildElements () |
Gets a collection of the child elements from the current source element. More... | |
IZptAttribute[] | GetAttributes () |
Gets a collection of the attributes present upon the current element. More... | |
IZptAttribute | GetAttribute (ZptNamespace attributeNamespace, string name) |
Gets an attribute which matches the given criteria, or a null reference is no matching attribute is found. More... | |
void | SetAttribute (string name, string value) |
Sets the value of an attribute. More... | |
void | SetAttribute (ZptNamespace attributeNamespace, string name, string value) |
Sets the value of an attribute. More... | |
void | RemoveAttribute (string name) |
Removes a named attribute. More... | |
void | RemoveAttribute (ZptNamespace attributeNamespace, string name) |
Removes a named attribute. More... | |
IZptElement[] | SearchChildrenByAttribute (ZptNamespace attributeNamespace, string name) |
Recursively searches the children of the current instance, returning a collection of elements which have an attribute matching the given criteria. More... | |
IZptElement | SearchAncestorsByAttribute (ZptNamespace attributeNamespace, string name) |
Recursively searches upwards in the DOM tree, returning the first (closest) ancestor element which has an attribute matching the given criteria. More... | |
void | PurgeAttributes (ZptNamespace attributeNamespace) |
Recursively searches for attributes with a given namespace or prefix and removes them from their parent element. More... | |
void | PurgeElements (ZptNamespace elementNamespace) |
Recursively searches for elements with a given namespace or prefix and removes them using the Omit behaviour. More... | |
void | AddCommentBefore (string comment) |
Adds a new comment to the DOM immediately before the current element. More... | |
void | AddCommentInside (string comment) |
Adds a new comment to the DOM inside the current element as its first child. More... | |
void | AddCommentAfter (string comment) |
Adds a new comment to the DOM immediately after the current element. More... | |
IZptElement | Clone () |
Clone this instance into a new Element instance, which may be manipulated without affecting the original. More... | |
string | GetFileLocation () |
Gets the file location (typically a line number) for the current instance. More... | |
string | GetEndTagFileLocation () |
Gets the file location (typically a line number) for the end tag matched with the current instance. More... | |
string | GetOriginalContextEndTagLocation () |
Gets the file location (typically a line number) for the end tag of an 'original context'. More... | |
ISourceInfo | GetOriginalContextSourceInfo () |
Gets information about the source of the current element. More... | |
IZptElement[] | Omit () |
Omits the current element, replacing it with its children. More... | |
void | Remove () |
Removes the current element from the DOM. More... | |
void | RemoveAllChildren () |
Removes all child elements from the current element. More... | |
bool | IsInNamespace (ZptNamespace nSpace) |
Determines whether or not the current instance is in the specified namespace. More... | |
bool | IsFromSameDocumentAs (IZptElement other) |
Determines whether this instance is from same document as the specified element. More... | |
string | GetFullFilePathAndLocation () |
Gets the full file path and location for the current element. More... | |
void | MarkAsImported (IZptElement originalElement) |
Marks the current element as being imported into its parent document (IE: it represents a context switch). More... | |
void | CacheSourceInformationInAttributes () |
Writes information to the underlying element's attributes recording its source information. More... | |
IZptDocument | CreateDocumentFromThisElement () |
Creates a new IZptDocument which contains only the current element and its children. More... | |
Properties | |
string | Name [get] |
Gets the element name. More... | |
bool | IsRoot [get] |
Gets a value indicating whether this instance is the root of its parent document. More... | |
bool | HasParent [get] |
Gets a value indicating whether this instance has a parent element or not. More... | |
bool | IsImported [get] |
Gets a value indicating whether this instance represents an element imported from another document tree. More... | |
Type | ZptDocumentType [get] |
Gets a System.Type indicating the type of IZptDocument to which the current instance belongs. More... | |
bool | CanWriteCommentWithoutParent [get] |
Gets a value indicating whether or not this instance can write a comment node to a node that does not have a parent. More... | |
IZptDocument | OwnerDocument [get] |
Gets the IZptDocument instance to which the current instance belongs. More... | |
Interface for a type which wraps a DOM element.
void CSF.Zpt.Rendering.IZptElement.AddCommentAfter | ( | string | comment | ) |
Adds a new comment to the DOM immediately after the current element.
comment | The comment text. |
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptHtmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.Rendering.ZptElement.
void CSF.Zpt.Rendering.IZptElement.AddCommentBefore | ( | string | comment | ) |
Adds a new comment to the DOM immediately before the current element.
comment | The comment text. |
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, CSF.Zpt.DocumentProviders.ZptHtmlElement, and CSF.Zpt.Rendering.ZptElement.
void CSF.Zpt.Rendering.IZptElement.AddCommentInside | ( | string | comment | ) |
Adds a new comment to the DOM inside the current element as its first child.
comment | The comment text. |
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptHtmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.Rendering.ZptElement.
void CSF.Zpt.Rendering.IZptElement.CacheSourceInformationInAttributes | ( | ) |
Writes information to the underlying element's attributes recording its source information.
Implemented in CSF.Zpt.Rendering.ZptElement.
IZptElement CSF.Zpt.Rendering.IZptElement.Clone | ( | ) |
Clone this instance into a new Element instance, which may be manipulated without affecting the original.
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, CSF.Zpt.DocumentProviders.ZptHtmlElement, and CSF.Zpt.Rendering.ZptElement.
IZptDocument CSF.Zpt.Rendering.IZptElement.CreateDocumentFromThisElement | ( | ) |
Creates a new IZptDocument which contains only the current element and its children.
Implemented in CSF.Zpt.Rendering.ZptElement, CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.
IZptAttribute CSF.Zpt.Rendering.IZptElement.GetAttribute | ( | ZptNamespace | attributeNamespace, |
string | name | ||
) |
Gets an attribute which matches the given criteria, or a null
reference is no matching attribute is found.
null
reference.attributeNamespace | The attribute namespace. |
name | The attribute name. |
Implemented in CSF.Zpt.DocumentProviders.ZptHtmlElement, CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.Rendering.ZptElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.
IZptAttribute [] CSF.Zpt.Rendering.IZptElement.GetAttributes | ( | ) |
Gets a collection of the attributes present upon the current element.
Implemented in CSF.Zpt.DocumentProviders.ZptHtmlElement, CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.Rendering.ZptElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.
IZptElement [] CSF.Zpt.Rendering.IZptElement.GetChildElements | ( | ) |
Gets a collection of the child elements from the current source element.
Implemented in CSF.Zpt.DocumentProviders.ZptHtmlElement, CSF.Zpt.Rendering.ZptElement, CSF.Zpt.DocumentProviders.ZptXmlElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.
IZptElement [] CSF.Zpt.Rendering.IZptElement.GetElementChain | ( | ) |
Gets an ordered element chain, starting with the current element and including all of its parent elements from closest to furthest ancestors.
Implemented in CSF.Zpt.Rendering.ZptElement.
string CSF.Zpt.Rendering.IZptElement.GetEndTagFileLocation | ( | ) |
Gets the file location (typically a line number) for the end tag matched with the current instance.
Implemented in CSF.Zpt.Rendering.ZptElement.
string CSF.Zpt.Rendering.IZptElement.GetFileLocation | ( | ) |
Gets the file location (typically a line number) for the current instance.
Implemented in CSF.Zpt.Rendering.ZptElement.
string CSF.Zpt.Rendering.IZptElement.GetFullFilePathAndLocation | ( | ) |
Gets the full file path and location for the current element.
Implemented in CSF.Zpt.Rendering.ZptElement.
string CSF.Zpt.Rendering.IZptElement.GetOriginalContextEndTagLocation | ( | ) |
Gets the file location (typically a line number) for the end tag of an 'original context'.
Implemented in CSF.Zpt.Rendering.ZptElement.
ISourceInfo CSF.Zpt.Rendering.IZptElement.GetOriginalContextSourceInfo | ( | ) |
Gets information about the source of the current element.
Implemented in CSF.Zpt.Rendering.ZptElement.
IZptElement CSF.Zpt.Rendering.IZptElement.GetParentElement | ( | ) |
Gets the element which is the parent of the current instance.
Implemented in CSF.Zpt.DocumentProviders.ZptHtmlElement, CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.Rendering.ZptElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.
ISourceInfo CSF.Zpt.Rendering.IZptElement.GetSourceInfo | ( | ) |
Gets information about the source of the current element.
Implemented in CSF.Zpt.Rendering.ZptElement.
IZptElement CSF.Zpt.Rendering.IZptElement.InsertAfter | ( | IZptElement | existing, |
IZptElement | newChild | ||
) |
Inserts a new child element into the current element's child elements. The new child will be the next sibling after a given existing child.
existing | An existing child element, after which the child will be inserted. |
newChild | The new child element to insert. |
Implemented in CSF.Zpt.DocumentProviders.ZptHtmlElement, CSF.Zpt.Rendering.ZptElement, CSF.Zpt.DocumentProviders.ZptXmlElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.
IZptElement CSF.Zpt.Rendering.IZptElement.InsertBefore | ( | IZptElement | existing, |
IZptElement | newChild | ||
) |
Inserts a new child element into the current element's child elements. The new child will be the previous sibling before a given existing child.
existing | An existing child element, before which the child will be inserted. |
newChild | The new child element to insert. |
Implemented in CSF.Zpt.Rendering.ZptElement, CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptHtmlElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.
bool CSF.Zpt.Rendering.IZptElement.IsFromSameDocumentAs | ( | IZptElement | other | ) |
Determines whether this instance is from same document as the specified element.
true
if this instance is from same document as the specified element; otherwise, false
.other | The element to test. |
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, CSF.Zpt.DocumentProviders.ZptHtmlElement, and CSF.Zpt.Rendering.ZptElement.
bool CSF.Zpt.Rendering.IZptElement.IsInNamespace | ( | ZptNamespace | nSpace | ) |
Determines whether or not the current instance is in the specified namespace.
true
if this instance is in the specified namespace; otherwise, false
. nSpace | The namespace for which to test. |
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, CSF.Zpt.DocumentProviders.ZptHtmlElement, and CSF.Zpt.Rendering.ZptElement.
void CSF.Zpt.Rendering.IZptElement.MarkAsImported | ( | IZptElement | originalElement | ) |
Marks the current element as being imported into its parent document (IE: it represents a context switch).
originalElement | The original element. |
Implemented in CSF.Zpt.Rendering.ZptElement.
IZptElement [] CSF.Zpt.Rendering.IZptElement.Omit | ( | ) |
Omits the current element, replacing it with its children.
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, CSF.Zpt.DocumentProviders.ZptHtmlElement, and CSF.Zpt.Rendering.ZptElement.
void CSF.Zpt.Rendering.IZptElement.PurgeAttributes | ( | ZptNamespace | attributeNamespace | ) |
Recursively searches for attributes with a given namespace or prefix and removes them from their parent element.
attributeNamespace | The attribute namespace. |
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptHtmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.Rendering.ZptElement.
void CSF.Zpt.Rendering.IZptElement.PurgeElements | ( | ZptNamespace | elementNamespace | ) |
Recursively searches for elements with a given namespace or prefix and removes them using the Omit behaviour.
elementNamespace | The element namespace. |
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, CSF.Zpt.DocumentProviders.ZptHtmlElement, and CSF.Zpt.Rendering.ZptElement.
void CSF.Zpt.Rendering.IZptElement.Remove | ( | ) |
Removes the current element from the DOM.
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, CSF.Zpt.DocumentProviders.ZptHtmlElement, and CSF.Zpt.Rendering.ZptElement.
void CSF.Zpt.Rendering.IZptElement.RemoveAllChildren | ( | ) |
Removes all child elements from the current element.
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, CSF.Zpt.DocumentProviders.ZptHtmlElement, and CSF.Zpt.Rendering.ZptElement.
void CSF.Zpt.Rendering.IZptElement.RemoveAttribute | ( | string | name | ) |
Removes a named attribute.
name | The attribtue name. |
Implemented in CSF.Zpt.Rendering.ZptElement.
void CSF.Zpt.Rendering.IZptElement.RemoveAttribute | ( | ZptNamespace | attributeNamespace, |
string | name | ||
) |
Removes a named attribute.
attributeNamespace | The attribute namespace. |
name | The attribute name. |
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptHtmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.Rendering.ZptElement.
void CSF.Zpt.Rendering.IZptElement.ReplaceChildrenWith | ( | string | content, |
bool | interpretContentAsStructure | ||
) |
Removes all children of the current element instance and replaces them with the given content.
content | The content with which to replace the children of the current element. |
interpretContentAsStructure | If set to true then the content is interpreted as structure. |
Implemented in CSF.Zpt.Rendering.ZptElement, CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.
IZptElement CSF.Zpt.Rendering.IZptElement.ReplaceWith | ( | IZptElement | replacement | ) |
Replaces the current element in its respective DOM with the given replacement.
replacement | Replacement. |
Implemented in CSF.Zpt.Rendering.ZptElement, CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.
IZptElement [] CSF.Zpt.Rendering.IZptElement.ReplaceWith | ( | string | content, |
bool | interpretContentAsStructure | ||
) |
Replaces the current element instance with the given content.
content | The content with which to replace the current element. |
interpretContentAsStructure | If set to true then the content is interpreted as structure. |
Implemented in CSF.Zpt.Rendering.ZptElement, CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.
IZptElement CSF.Zpt.Rendering.IZptElement.SearchAncestorsByAttribute | ( | ZptNamespace | attributeNamespace, |
string | name | ||
) |
Recursively searches upwards in the DOM tree, returning the first (closest) ancestor element which has an attribute matching the given criteria.
null
reference if no ancestor was found.attributeNamespace | The attribute namespace. |
name | The attribute name. |
Implemented in CSF.Zpt.Rendering.ZptElement.
IZptElement [] CSF.Zpt.Rendering.IZptElement.SearchChildrenByAttribute | ( | ZptNamespace | attributeNamespace, |
string | name | ||
) |
Recursively searches the children of the current instance, returning a collection of elements which have an attribute matching the given criteria.
attributeNamespace | The attribute namespace. |
name | The attribute name. |
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptHtmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.Rendering.ZptElement.
void CSF.Zpt.Rendering.IZptElement.SetAttribute | ( | string | name, |
string | value | ||
) |
Sets the value of an attribute.
name | The attribute name. |
value | The attribute value. |
Implemented in CSF.Zpt.Rendering.ZptElement.
void CSF.Zpt.Rendering.IZptElement.SetAttribute | ( | ZptNamespace | attributeNamespace, |
string | name, | ||
string | value | ||
) |
Sets the value of an attribute.
attributeNamespace | The attribute namespace. |
name | The attribute name. |
value | The attribute value. |
Implemented in CSF.Zpt.DocumentProviders.ZptHtmlElement, CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.Rendering.ZptElement.
string CSF.Zpt.Rendering.IZptElement.ToString | ( | ) |
Returns a System.String that represents the current IZptElement.
Implemented in CSF.Zpt.Rendering.ZptElement, CSF.Zpt.DocumentProviders.ZptHtmlElement, CSF.Zpt.DocumentProviders.ZptXmlElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.
|
get |
Gets a value indicating whether or not this instance can write a comment node to a node that does not have a parent.
true
if this instance can write a comment node if it does not have a parent; otherwise, false
.
|
get |
Gets a value indicating whether this instance has a parent element or not.
true
if this instance has a parent element; otherwise, false
.
|
get |
Gets a value indicating whether this instance represents an element imported from another document tree.
true
if this instance is imported; otherwise, false
.
|
get |
Gets a value indicating whether this instance is the root of its parent document.
true
if this instance is the root element; otherwise, false
.
|
get |
Gets the element name.
The name.
|
get |
Gets the IZptDocument instance to which the current instance belongs.
|
get |
Gets a System.Type
indicating the type of IZptDocument to which the current instance belongs.
The type of ZPT document implementation.