ZPT-Sharp  v1.0.0
Zope Page Templates for .NET
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
CSF.Zpt.Rendering.ZptElement Class Referenceabstract

Represents an element node in a ZPT document. More...

Inheritance diagram for CSF.Zpt.Rendering.ZptElement:
Collaboration diagram for CSF.Zpt.Rendering.ZptElement:

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...
 

Detailed Description

Represents an element node in a ZPT document.

Constructor & Destructor Documentation

CSF.Zpt.Rendering.ZptElement.ZptElement ( )
inlineprotected

Fake constructor for Mocking framework usage only. Do not call.

CSF.Zpt.Rendering.ZptElement.ZptElement ( ISourceInfo  sourceFile,
bool  isRoot,
bool  isImported,
IZptDocument  ownerDocument,
ISourceInfoFactory  sourceInfoCreator = null 
)
inline

Initializes a new instance of the CSF.Zpt.Rendering.ZptElement class.

Parameters
sourceFileInformation about the element's source file.
isRootWhether or not this is the root element.
isImportedWhether or not this element is imported.
ownerDocumentThe ZPT document which owns the element.
sourceInfoCreatorA source-info factory.

Member Function Documentation

abstract void CSF.Zpt.Rendering.ZptElement.AddCommentAfter ( string  comment)
pure virtual

Adds a new comment to the DOM immediately after the current element.

Parameters
commentThe comment text.

Implements CSF.Zpt.Rendering.IZptElement.

Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptHtmlElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.

abstract void CSF.Zpt.Rendering.ZptElement.AddCommentBefore ( string  comment)
pure virtual

Adds a new comment to the DOM immediately before the current element.

Parameters
commentThe comment text.

Implements CSF.Zpt.Rendering.IZptElement.

Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.

abstract void CSF.Zpt.Rendering.ZptElement.AddCommentInside ( string  comment)
pure virtual

Adds a new comment to the DOM inside the current element as its first child.

Parameters
commentThe comment text.

Implements CSF.Zpt.Rendering.IZptElement.

Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptHtmlElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.

virtual void CSF.Zpt.Rendering.ZptElement.CacheSourceInformationInAttributes ( )
inlinevirtual

Writes information to the underlying element's attributes recording its source information.

Implements CSF.Zpt.Rendering.IZptElement.

abstract IZptElement CSF.Zpt.Rendering.ZptElement.Clone ( )
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.

virtual TElement CSF.Zpt.Rendering.ZptElement.ConvertTo< TElement > ( IZptElement  element)
inlineprotectedvirtual

Converts the given IZptElement to an implementation-specific subclass, or raises an exception if the conversion is not valid.

Returns
The converted element instance.
Parameters
elementThe element for conversion.
Template Parameters
TElementThe desired element type.
Type Constraints
TElement :class 
TElement :IZptElement 
abstract IZptDocument CSF.Zpt.Rendering.ZptElement.CreateDocumentFromThisElement ( )
pure virtual

Creates a new IZptDocument which contains only the current element and its children.

Returns
A new document instance.

Implements CSF.Zpt.Rendering.IZptElement.

Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.

static void CSF.Zpt.Rendering.ZptElement.EnforceNameNotEmpty ( string  name)
inlinestaticprotected

Enforces that a name must not be null or empty, raising an exception if it is.

Parameters
nameName.
virtual void CSF.Zpt.Rendering.ZptElement.EnforceNodeType< TNodeType > ( string  expectedNodeLanguage,
TNodeType  expectedNodeType,
TNodeType  actualNodeType 
)
inlineprotectedvirtual

Enforces that two objects (expected and actual), representing node types, are equal. Raises an exception if they are not.

Parameters
expectedNodeLanguageExpected node language (EG: "XML").
expectedNodeTypeExpected node type.
actualNodeTypeActual node type.
Template Parameters
TNodeTypeThe type of objects being compared.
virtual void CSF.Zpt.Rendering.ZptElement.EnforceParentNodeNotNull ( object  parentNode)
inlineprotectedvirtual

Enforces that an System.Object (representing a parent node) is not null, raising an exception if it is not.

Parameters
parentNodeThe parent node.
override bool CSF.Zpt.Rendering.ZptElement.Equals ( object  obj)
inline

Determines whether the specified System.Object is equal to the current CSF.Zpt.Rendering.ZptElement.

Parameters
objThe System.Object to compare with the current CSF.Zpt.Rendering.ZptElement.
Returns
true if the specified System.Object is equal to the current CSF.Zpt.Rendering.ZptElement; otherwise, false.
virtual bool CSF.Zpt.Rendering.ZptElement.Equals ( IZptElement  obj)
inlinevirtual

Determines whether the specified CSF.Zpt.Rendering.IZptElement is equal to the current CSF.Zpt.Rendering.ZptElement.

Parameters
objThe CSF.Zpt.Rendering.IZptElement to compare with the current CSF.Zpt.Rendering.ZptElement.
Returns
true if the specified CSF.Zpt.Rendering.IZptElement is equal to the current CSF.Zpt.Rendering.ZptElement; otherwise, false.
abstract bool CSF.Zpt.Rendering.ZptElement.Equals ( ZptElement  other)
pure virtual

Determines whether the specified CSF.Zpt.Rendering.ZptElement is equal to the current CSF.Zpt.Rendering.ZptElement.

Parameters
otherThe CSF.Zpt.Rendering.ZptElement to compare with the current CSF.Zpt.Rendering.ZptElement.
Returns
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.

abstract IZptAttribute CSF.Zpt.Rendering.ZptElement.GetAttribute ( ZptNamespace  attributeNamespace,
string  name 
)
pure virtual

Gets an attribute which matches the given criteria, or a null reference is no matching attribute is found.

Returns
The attribute, or a null reference.
Parameters
attributeNamespaceThe attribute namespace.
nameThe attribute name.

Implements CSF.Zpt.Rendering.IZptElement.

Implemented in CSF.Zpt.DocumentProviders.ZptHtmlElement, CSF.Zpt.DocumentProviders.ZptXmlElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.

abstract IZptAttribute [] CSF.Zpt.Rendering.ZptElement.GetAttributes ( )
pure virtual

Gets a collection of the attributes present upon the current element.

Returns
The attributes.

Implements CSF.Zpt.Rendering.IZptElement.

Implemented in CSF.Zpt.DocumentProviders.ZptHtmlElement, CSF.Zpt.DocumentProviders.ZptXmlElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.

abstract IZptElement [] CSF.Zpt.Rendering.ZptElement.GetChildElements ( )
pure virtual

Gets a collection of the child elements from the current source element.

Returns
The children.

Implements CSF.Zpt.Rendering.IZptElement.

Implemented in CSF.Zpt.DocumentProviders.ZptHtmlElement, CSF.Zpt.DocumentProviders.ZptXmlElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.

virtual IZptElement [] CSF.Zpt.Rendering.ZptElement.GetElementChain ( )
inlinevirtual

Gets an ordered element chain, starting with the current element and including all of its parent elements from closest to furthest ancestors.

Returns
The element chain.

Implements CSF.Zpt.Rendering.IZptElement.

virtual string CSF.Zpt.Rendering.ZptElement.GetEndTagFileLocation ( )
inlinevirtual

Gets the file location (typically a line number) for the end tag matched with the current instance.

Returns
The end tag file location.

Implements CSF.Zpt.Rendering.IZptElement.

virtual string CSF.Zpt.Rendering.ZptElement.GetFileLocation ( )
inlinevirtual

Gets the file location (typically a line number) for the current instance.

Returns
The file location.

Implements CSF.Zpt.Rendering.IZptElement.

virtual string CSF.Zpt.Rendering.ZptElement.GetFullFilePathAndLocation ( )
inlinevirtual

Gets the full file path and location for the current element.

Returns
The full file path and location.

Implements CSF.Zpt.Rendering.IZptElement.

abstract override int CSF.Zpt.Rendering.ZptElement.GetHashCode ( )
pure virtual

Serves as a hash function for a CSF.Zpt.Rendering.ZptElement object.

Returns
A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a hash table.

Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.

abstract string CSF.Zpt.Rendering.ZptElement.GetNativeEndTagFileLocation ( )
protectedpure virtual

Gets the file location (typically a line number) for the end tag matched with the current instance.

Returns
The end tag file location.

Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.

abstract string CSF.Zpt.Rendering.ZptElement.GetNativeFileLocation ( )
protectedpure virtual

Gets the file location (typically a line number) for the current instance.

Returns
The file location.

Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.

virtual string CSF.Zpt.Rendering.ZptElement.GetOriginalContextEndTagLocation ( )
inlinevirtual

Gets the file location (typically a line number) for the end tag of an 'original context'.

Returns
The end tag file location.

Implements CSF.Zpt.Rendering.IZptElement.

virtual ISourceInfo CSF.Zpt.Rendering.ZptElement.GetOriginalContextSourceInfo ( )
inlinevirtual

Gets information about the source of the current element.

Returns
The end tag file location.

Implements CSF.Zpt.Rendering.IZptElement.

abstract IZptElement CSF.Zpt.Rendering.ZptElement.GetParentElement ( )
pure virtual

Gets the element which is the parent of the current instance.

Returns
The parent element.

Implements CSF.Zpt.Rendering.IZptElement.

Implemented in CSF.Zpt.DocumentProviders.ZptHtmlElement, CSF.Zpt.DocumentProviders.ZptXmlElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.

ISourceInfo CSF.Zpt.Rendering.ZptElement.GetSourceInfo ( )
inline

Gets information about the source of the current element.

Implements CSF.Zpt.Rendering.IZptElement.

abstract IZptElement CSF.Zpt.Rendering.ZptElement.InsertAfter ( IZptElement  existing,
IZptElement  newChild 
)
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.

Returns
The newly-added element.
Parameters
existingAn existing child element, after which the child will be inserted.
newChildThe 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.

abstract IZptElement CSF.Zpt.Rendering.ZptElement.InsertBefore ( IZptElement  existing,
IZptElement  newChild 
)
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.

Returns
The newly-added element.
Parameters
existingAn existing child element, before which the child will be inserted.
newChildThe 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.

abstract bool CSF.Zpt.Rendering.ZptElement.IsFromSameDocumentAs ( IZptElement  other)
pure virtual

Determines whether this instance is from same document as the specified element.

Returns
true if this instance is from same document as the specified element; otherwise, false.
Parameters
otherThe element to test.

Implements CSF.Zpt.Rendering.IZptElement.

Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.

abstract bool CSF.Zpt.Rendering.ZptElement.IsInNamespace ( ZptNamespace  nSpace)
pure virtual

Determines whether or not the current instance is in the specified namespace.

Returns
true if this instance is in the specified namespace; otherwise, false.
Parameters
nSpaceThe 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.

virtual void CSF.Zpt.Rendering.ZptElement.MarkAsImported ( IZptElement  originalElement)
inlinevirtual

Marks the current element as being imported into its parent document (IE: it represents a context switch).

Parameters
originalElementThe original element.

Implements CSF.Zpt.Rendering.IZptElement.

abstract IZptElement [] CSF.Zpt.Rendering.ZptElement.Omit ( )
pure virtual

Omits the current element, replacing it with its children.

Returns
A collection of the IZptElement instances which were children of the element traversed

Implements CSF.Zpt.Rendering.IZptElement.

Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.

abstract void CSF.Zpt.Rendering.ZptElement.PurgeAttributes ( ZptNamespace  attributeNamespace)
pure virtual

Recursively searches for attributes with a given namespace or prefix and removes them from their parent element.

Parameters
attributeNamespaceThe attribute namespace.

Implements CSF.Zpt.Rendering.IZptElement.

Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptHtmlElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.

abstract void CSF.Zpt.Rendering.ZptElement.PurgeElements ( ZptNamespace  elementNamespace)
pure virtual

Recursively searches for elements with a given namespace or prefix and removes them using the Omit behaviour.

Parameters
elementNamespaceThe element namespace.

Implements CSF.Zpt.Rendering.IZptElement.

Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.

abstract void CSF.Zpt.Rendering.ZptElement.Remove ( )
pure virtual
abstract void CSF.Zpt.Rendering.ZptElement.RemoveAllChildren ( )
pure virtual
virtual void CSF.Zpt.Rendering.ZptElement.RemoveAttribute ( string  name)
inlinevirtual

Removes a named attribute.

Parameters
nameThe attribtue name.

Implements CSF.Zpt.Rendering.IZptElement.

abstract void CSF.Zpt.Rendering.ZptElement.RemoveAttribute ( ZptNamespace  attributeNamespace,
string  name 
)
pure virtual

Removes a named attribute.

Parameters
attributeNamespaceThe attribute namespace.
nameThe attribute name.

Implements CSF.Zpt.Rendering.IZptElement.

Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptHtmlElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.

abstract void CSF.Zpt.Rendering.ZptElement.ReplaceChildrenWith ( string  content,
bool  interpretContentAsStructure 
)
pure virtual

Removes all children of the current element instance and replaces them with the given content.

Parameters
contentThe content with which to replace the children of the current element.
interpretContentAsStructureIf 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.

abstract IZptElement CSF.Zpt.Rendering.ZptElement.ReplaceWith ( IZptElement  replacement)
pure virtual

Replaces the current element in its respective DOM with the given replacement.

Returns
A reference to the replacement element, in its new DOM.
Parameters
replacementReplacement.

Implements CSF.Zpt.Rendering.IZptElement.

Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptXmlLinqElement, and CSF.Zpt.DocumentProviders.ZptHtmlElement.

abstract IZptElement [] CSF.Zpt.Rendering.ZptElement.ReplaceWith ( string  content,
bool  interpretContentAsStructure 
)
pure virtual

Replaces the current element instance with the given content.

Returns
A collection of IZptElement, indicating the element(s) which replaced the current instance.
Parameters
contentThe content with which to replace the current element.
interpretContentAsStructureIf 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.

virtual IZptElement CSF.Zpt.Rendering.ZptElement.SearchAncestorsByAttribute ( ZptNamespace  attributeNamespace,
string  name 
)
inlinevirtual

Recursively searches upwards in the DOM tree, returning the first (closest) ancestor element which has an attribute matching the given criteria.

Returns
The closest ancestor element, or a null reference if no ancestor was found.
Parameters
attributeNamespaceThe attribute namespace.
nameThe attribute name.

Implements CSF.Zpt.Rendering.IZptElement.

abstract IZptElement [] CSF.Zpt.Rendering.ZptElement.SearchChildrenByAttribute ( ZptNamespace  attributeNamespace,
string  name 
)
pure virtual

Recursively searches the children of the current instance, returning a collection of elements which have an attribute matching the given criteria.

Returns
The matching child elements.
Parameters
attributeNamespaceThe attribute namespace.
nameThe attribute name.

Implements CSF.Zpt.Rendering.IZptElement.

Implemented in CSF.Zpt.DocumentProviders.ZptXmlElement, CSF.Zpt.DocumentProviders.ZptHtmlElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.

virtual void CSF.Zpt.Rendering.ZptElement.SetAttribute ( string  name,
string  value 
)
inlinevirtual

Sets the value of an attribute.

Parameters
nameThe attribute name.
valueThe attribute value.

Implements CSF.Zpt.Rendering.IZptElement.

abstract void CSF.Zpt.Rendering.ZptElement.SetAttribute ( ZptNamespace  attributeNamespace,
string  name,
string  value 
)
pure virtual

Sets the value of an attribute.

Parameters
attributeNamespaceThe attribute namespace.
nameThe attribute name.
valueThe attribute value.

Implements CSF.Zpt.Rendering.IZptElement.

Implemented in CSF.Zpt.DocumentProviders.ZptHtmlElement, CSF.Zpt.DocumentProviders.ZptXmlElement, and CSF.Zpt.DocumentProviders.ZptXmlLinqElement.

abstract new string CSF.Zpt.Rendering.ZptElement.ToString ( )
pure virtual

Returns a System.String that represents the current ZptElement.

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.

Property Documentation

abstract bool CSF.Zpt.Rendering.ZptElement.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.

true if this instance can write a comment node if it does not have a parent; otherwise, false.

abstract bool CSF.Zpt.Rendering.ZptElement.HasParent
get

Gets a value indicating whether this instance has a parent element or not.

true if this instance has a parent element; otherwise, false.

virtual bool CSF.Zpt.Rendering.ZptElement.IsImported
get

Gets a value indicating whether this instance represents an element imported from another document tree.

true if this instance is imported; otherwise, false.

virtual bool CSF.Zpt.Rendering.ZptElement.IsRoot
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.

abstract string CSF.Zpt.Rendering.ZptElement.Name
get

Gets the element name.

The name.

virtual IZptDocument CSF.Zpt.Rendering.ZptElement.OwnerDocument
get

Gets the IZptDocument instance to which the current instance belongs.

abstract Type CSF.Zpt.Rendering.ZptElement.ZptDocumentType
get

Gets a System.Type indicating the type of IZptDocument to which the current instance belongs.

The type of ZPT document implementation.


The documentation for this class was generated from the following file: