|
ZPT-Sharp
v1.0.0
Zope Page Templates for .NET
|
Represents an element node in a ZPT document. More...


Public Member Functions | |
| ISourceInfo | GetSourceInfo () |
| Gets information about the source of the current element. More... | |
| abstract new string | ToString () |
| Returns a System.String that represents the current ZptElement. More... | |
| override bool | Equals (object obj) |
| Determines whether the specified System.Object is equal to the current CSF.Zpt.Rendering.ZptElement. More... | |
| virtual bool | Equals (IZptElement obj) |
| Determines whether the specified CSF.Zpt.Rendering.IZptElement is equal to the current CSF.Zpt.Rendering.ZptElement. More... | |
| abstract bool | Equals (ZptElement other) |
| Determines whether the specified CSF.Zpt.Rendering.ZptElement is equal to the current CSF.Zpt.Rendering.ZptElement. More... | |
| abstract override int | GetHashCode () |
| Serves as a hash function for a CSF.Zpt.Rendering.ZptElement object. More... | |
| abstract IZptElement | ReplaceWith (IZptElement replacement) |
| Replaces the current element in its respective DOM with the given replacement. More... | |
| abstract IZptElement[] | ReplaceWith (string content, bool interpretContentAsStructure) |
| Replaces the current element instance with the given content. More... | |
| abstract void | ReplaceChildrenWith (string content, bool interpretContentAsStructure) |
| Removes all children of the current element instance and replaces them with the given content. More... | |
| abstract 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... | |
| abstract 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... | |
| abstract IZptElement | GetParentElement () |
| Gets the element which is the parent of the current instance. More... | |
| virtual 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... | |
| abstract IZptElement[] | GetChildElements () |
| Gets a collection of the child elements from the current source element. More... | |
| abstract IZptAttribute[] | GetAttributes () |
| Gets a collection of the attributes present upon the current element. More... | |
| abstract 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... | |
| virtual void | SetAttribute (string name, string value) |
| Sets the value of an attribute. More... | |
| abstract void | SetAttribute (ZptNamespace attributeNamespace, string name, string value) |
| Sets the value of an attribute. More... | |
| virtual void | RemoveAttribute (string name) |
| Removes a named attribute. More... | |
| abstract void | RemoveAttribute (ZptNamespace attributeNamespace, string name) |
| Removes a named attribute. More... | |
| abstract 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... | |
| virtual 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... | |
| abstract void | PurgeAttributes (ZptNamespace attributeNamespace) |
| Recursively searches for attributes with a given namespace or prefix and removes them from their parent element. More... | |
| abstract void | PurgeElements (ZptNamespace elementNamespace) |
| Recursively searches for elements with a given namespace or prefix and removes them using the Omit behaviour. More... | |
| abstract void | AddCommentBefore (string comment) |
| Adds a new comment to the DOM immediately before the current element. More... | |
| abstract void | AddCommentInside (string comment) |
| Adds a new comment to the DOM inside the current element as its first child. More... | |
| abstract void | AddCommentAfter (string comment) |
| Adds a new comment to the DOM immediately after the current element. More... | |
| abstract IZptElement | Clone () |
| Clone this instance into a new Element instance, which may be manipulated without affecting the original. More... | |
| virtual string | GetFileLocation () |
| Gets the file location (typically a line number) for the current instance. More... | |
| virtual string | GetEndTagFileLocation () |
| Gets the file location (typically a line number) for the end tag matched with the current instance. More... | |
| virtual string | GetOriginalContextEndTagLocation () |
| Gets the file location (typically a line number) for the end tag of an 'original context'. More... | |
| virtual ISourceInfo | GetOriginalContextSourceInfo () |
| Gets information about the source of the current element. More... | |
| abstract IZptElement[] | Omit () |
| Omits the current element, replacing it with its children. More... | |
| abstract void | Remove () |
| Removes the current element from the DOM. More... | |
| abstract void | RemoveAllChildren () |
| Removes all child elements from the current element. More... | |
| abstract bool | IsInNamespace (ZptNamespace nSpace) |
| Determines whether or not the current instance is in the specified namespace. More... | |
| abstract bool | IsFromSameDocumentAs (IZptElement other) |
| Determines whether this instance is from same document as the specified element. More... | |
| virtual string | GetFullFilePathAndLocation () |
| Gets the full file path and location for the current element. More... | |
| virtual void | CacheSourceInformationInAttributes () |
| Writes information to the underlying element's attributes recording its source information. More... | |
| virtual void | MarkAsImported (IZptElement originalElement) |
| Marks the current element as being imported into its parent document (IE: it represents a context switch). More... | |
| abstract IZptDocument | CreateDocumentFromThisElement () |
| Creates a new IZptDocument which contains only the current element and its children. More... | |
| ZptElement (ISourceInfo sourceFile, bool isRoot, bool isImported, IZptDocument ownerDocument, ISourceInfoFactory sourceInfoCreator=null) | |
| Initializes a new instance of the CSF.Zpt.Rendering.ZptElement class. More... | |
Protected Member Functions | |
| abstract string | GetNativeFileLocation () |
| Gets the file location (typically a line number) for the current instance. More... | |
| abstract string | GetNativeEndTagFileLocation () |
| Gets the file location (typically a line number) for the end tag matched with the current instance. More... | |
| virtual TElement | ConvertTo< TElement > (IZptElement element) |
| Converts the given IZptElement to an implementation-specific subclass, or raises an exception if the conversion is not valid. More... | |
| virtual void | EnforceParentNodeNotNull (object parentNode) |
Enforces that an System.Object (representing a parent node) is not null, raising an exception if it is not. More... | |
| virtual void | EnforceNodeType< TNodeType > (string expectedNodeLanguage, TNodeType expectedNodeType, TNodeType actualNodeType) |
| Enforces that two objects (expected and actual), representing node types, are equal. Raises an exception if they are not. More... | |
| ZptElement () | |
| Fake constructor for Mocking framework usage only. Do not call. More... | |
Static Protected Member Functions | |
| static void | EnforceNameNotEmpty (string name) |
Enforces that a name must not be null or empty, raising an exception if it is. More... | |
Properties | |
| abstract string | Name [get] |
| Gets the element name. More... | |
| virtual bool | IsRoot [get] |
| Gets a value indicating whether this instance is the root of its parent document. More... | |
| abstract bool | HasParent [get] |
| Gets a value indicating whether this instance has a parent element or not. More... | |
| virtual bool | IsImported [get] |
| Gets a value indicating whether this instance represents an element imported from another document tree. More... | |
| abstract Type | ZptDocumentType [get] |
Gets a System.Type indicating the type of IZptDocument to which the current instance belongs. More... | |
| abstract 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... | |
| virtual IZptDocument | OwnerDocument [get] |
| Gets the IZptDocument instance to which the current instance belongs. More... | |
Properties inherited from CSF.Zpt.Rendering.IZptElement | |
| 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... | |
Represents an element node in a ZPT document.
|
inlineprotected |
Fake constructor for Mocking framework usage only. Do not call.
|
inline |
Initializes a new instance of the CSF.Zpt.Rendering.ZptElement class.
| sourceFile | Information about the element's source file. |
| isRoot | Whether or not this is the root element. |
| isImported | Whether or not this element is imported. |
| ownerDocument | The ZPT document which owns the element. |
| sourceInfoCreator | A source-info factory. |
|
pure virtual |
Adds a new comment to the DOM immediately after the current element.
| comment | The comment text. |
Implements CSF.Zpt.Rendering.IZptElement.
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptHtmlElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.
|
pure virtual |
Adds a new comment to the DOM immediately before the current element.
| comment | The comment text. |
Implements CSF.Zpt.Rendering.IZptElement.
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.
|
pure virtual |
Adds a new comment to the DOM inside the current element as its first child.
| comment | The comment text. |
Implements CSF.Zpt.Rendering.IZptElement.
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptHtmlElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.
|
inlinevirtual |
Writes information to the underlying element's attributes recording its source information.
Implements CSF.Zpt.Rendering.IZptElement.
|
pure virtual |
Clone this instance into a new Element instance, which may be manipulated without affecting the original.
Implements CSF.Zpt.Rendering.IZptElement.
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.
|
inlineprotectedvirtual |
Converts the given IZptElement to an implementation-specific subclass, or raises an exception if the conversion is not valid.
| element | The element for conversion. |
| TElement | The desired element type. |
| TElement | : | class | |
| TElement | : | IZptElement |
|
pure virtual |
Creates a new IZptDocument which contains only the current element and its children.
Implements CSF.Zpt.Rendering.IZptElement.
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.
|
inlinestaticprotected |
Enforces that a name must not be null or empty, raising an exception if it is.
| name | Name. |
|
inlineprotectedvirtual |
Enforces that two objects (expected and actual), representing node types, are equal. Raises an exception if they are not.
| expectedNodeLanguage | Expected node language (EG: "XML"). |
| expectedNodeType | Expected node type. |
| actualNodeType | Actual node type. |
| TNodeType | The type of objects being compared. |
|
inlineprotectedvirtual |
Enforces that an System.Object (representing a parent node) is not null, raising an exception if it is not.
| parentNode | The parent node. |
|
inline |
Determines whether the specified System.Object is equal to the current CSF.Zpt.Rendering.ZptElement.
| obj | The System.Object to compare with the current CSF.Zpt.Rendering.ZptElement. |
true if the specified System.Object is equal to the current CSF.Zpt.Rendering.ZptElement; otherwise, false.
|
inlinevirtual |
Determines whether the specified CSF.Zpt.Rendering.IZptElement is equal to the current CSF.Zpt.Rendering.ZptElement.
| obj | The CSF.Zpt.Rendering.IZptElement to compare with the current CSF.Zpt.Rendering.ZptElement. |
true if the specified CSF.Zpt.Rendering.IZptElement is equal to the current CSF.Zpt.Rendering.ZptElement; otherwise, false.
|
pure virtual |
Determines whether the specified CSF.Zpt.Rendering.ZptElement is equal to the current CSF.Zpt.Rendering.ZptElement.
| other | The CSF.Zpt.Rendering.ZptElement to compare with the current CSF.Zpt.Rendering.ZptElement. |
true if the specified CSF.Zpt.Rendering.ZptElement is equal to the current CSF.Zpt.Rendering.ZptElement; otherwise, false. Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.
|
pure virtual |
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. |
Implements CSF.Zpt.Rendering.IZptElement.
Implemented in CSF.Zpt.DocumentProviders.ZptHtmlElement, CSF.Zpt.DocumentProviders.ZptXmlElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.
|
pure virtual |
Gets a collection of the attributes present upon the current element.
Implements CSF.Zpt.Rendering.IZptElement.
Implemented in CSF.Zpt.DocumentProviders.ZptHtmlElement, CSF.Zpt.DocumentProviders.ZptXmlElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.
|
pure virtual |
Gets a collection of the child elements from the current source element.
Implements CSF.Zpt.Rendering.IZptElement.
Implemented in CSF.Zpt.DocumentProviders.ZptHtmlElement, CSF.Zpt.DocumentProviders.ZptXmlElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.
|
inlinevirtual |
Gets an ordered element chain, starting with the current element and including all of its parent elements from closest to furthest ancestors.
Implements CSF.Zpt.Rendering.IZptElement.
|
inlinevirtual |
Gets the file location (typically a line number) for the end tag matched with the current instance.
Implements CSF.Zpt.Rendering.IZptElement.
|
inlinevirtual |
Gets the file location (typically a line number) for the current instance.
Implements CSF.Zpt.Rendering.IZptElement.
|
inlinevirtual |
Gets the full file path and location for the current element.
Implements CSF.Zpt.Rendering.IZptElement.
|
pure virtual |
Serves as a hash function for a CSF.Zpt.Rendering.ZptElement object.
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.
|
protectedpure virtual |
Gets the file location (typically a line number) for the end tag matched with the current instance.
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.
|
protectedpure virtual |
Gets the file location (typically a line number) for the current instance.
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.
|
inlinevirtual |
Gets the file location (typically a line number) for the end tag of an 'original context'.
Implements CSF.Zpt.Rendering.IZptElement.
|
inlinevirtual |
Gets information about the source of the current element.
Implements CSF.Zpt.Rendering.IZptElement.
|
pure virtual |
Gets the element which is the parent of the current instance.
Implements CSF.Zpt.Rendering.IZptElement.
Implemented in CSF.Zpt.DocumentProviders.ZptHtmlElement, CSF.Zpt.DocumentProviders.ZptXmlElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.
|
inline |
Gets information about the source of the current element.
Implements CSF.Zpt.Rendering.IZptElement.
|
pure virtual |
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. |
Implements CSF.Zpt.Rendering.IZptElement.
Implemented in CSF.Zpt.DocumentProviders.ZptHtmlElement, CSF.Zpt.DocumentProviders.ZptXmlElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.
|
pure virtual |
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. |
Implements CSF.Zpt.Rendering.IZptElement.
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptHtmlElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.
|
pure virtual |
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. |
Implements CSF.Zpt.Rendering.IZptElement.
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.
|
pure virtual |
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. |
Implements CSF.Zpt.Rendering.IZptElement.
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.
|
inlinevirtual |
Marks the current element as being imported into its parent document (IE: it represents a context switch).
| originalElement | The original element. |
Implements CSF.Zpt.Rendering.IZptElement.
|
pure virtual |
Omits the current element, replacing it with its children.
Implements CSF.Zpt.Rendering.IZptElement.
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.
|
pure virtual |
Recursively searches for attributes with a given namespace or prefix and removes them from their parent element.
| attributeNamespace | The attribute namespace. |
Implements CSF.Zpt.Rendering.IZptElement.
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptHtmlElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.
|
pure virtual |
Recursively searches for elements with a given namespace or prefix and removes them using the Omit behaviour.
| elementNamespace | The element namespace. |
Implements CSF.Zpt.Rendering.IZptElement.
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.
|
pure virtual |
Removes the current element from the DOM.
Implements CSF.Zpt.Rendering.IZptElement.
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.
|
pure virtual |
Removes all child elements from the current element.
Implements CSF.Zpt.Rendering.IZptElement.
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.
|
inlinevirtual |
Removes a named attribute.
| name | The attribtue name. |
Implements CSF.Zpt.Rendering.IZptElement.
|
pure virtual |
Removes a named attribute.
| attributeNamespace | The attribute namespace. |
| name | The attribute name. |
Implements CSF.Zpt.Rendering.IZptElement.
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptHtmlElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.
|
pure virtual |
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. |
Implements CSF.Zpt.Rendering.IZptElement.
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.
|
pure virtual |
Replaces the current element in its respective DOM with the given replacement.
| replacement | Replacement. |
Implements CSF.Zpt.Rendering.IZptElement.
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.
|
pure virtual |
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. |
Implements CSF.Zpt.Rendering.IZptElement.
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.
|
inlinevirtual |
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. |
Implements CSF.Zpt.Rendering.IZptElement.
|
pure virtual |
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. |
Implements CSF.Zpt.Rendering.IZptElement.
Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptHtmlElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.
|
inlinevirtual |
Sets the value of an attribute.
| name | The attribute name. |
| value | The attribute value. |
Implements CSF.Zpt.Rendering.IZptElement.
|
pure virtual |
Sets the value of an attribute.
| attributeNamespace | The attribute namespace. |
| name | The attribute name. |
| value | The attribute value. |
Implements CSF.Zpt.Rendering.IZptElement.
Implemented in CSF.Zpt.DocumentProviders.ZptHtmlElement, CSF.Zpt.DocumentProviders.ZptXmlElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.
|
pure virtual |
Returns a System.String that represents the current ZptElement.
Implements CSF.Zpt.Rendering.IZptElement.
Implemented in 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.