Class XContainerAbstract

Represents a node that can contain other nodes. The two classes that derive from XContainer are XDocument and XElement.

Hierarchy

Constructors

Accessors

  • Gets the XDocument object for this XObject.

    Returns null | XDocument

  • get firstNode(): null | XNode
  • Gets this container's first XNode or null, if this container does not have any nodes.

    Returns null | XNode

  • get lastNode(): null | XNode
  • Gets this container's last XNode or null, if this container does not have any nodes.

    Returns null | XNode

  • get nextNode(): null | XNode
  • Gets the next sibling node of this node.

    If this node does not have a parent, or if there is no next node, then this property returns null.

    Returns null | XNode

  • Gets the parent XElement of this XObject.

    Returns null | XElement

  • get previousNode(): null | XNode
  • Gets the previous sibling node of this node.

    If this property does not have a parent, or if there is no previous node, then this property returns null.

    Returns null | XNode

Methods

  • add(content: any): void
  • Adds the specified content as a child (or children) of this XContainer.

    Parameters

    • content: any

      A content object containing simple content or a collection of content objects to be added.

    Returns void

  • Returns the collection of the ancestor elements for this node.

    Returns

    The ancestor elements of this node.

    Parameters

    • Optional name: null | XName

      The optional name of the ancestor elements to find.

    Returns LinqElements

  • Gets the descendant XElements of this XContainer.

    Returns

    The descendant XElements of this XContainer.

    Parameters

    • Optional name: null | XName

      The optional name of the descendants to return.

    Returns LinqElements

  • Gets the child XElements of this XContainer.

    Returns

    The child XElements of this XContainer.

    Parameters

    • Optional name: null | XName

      The optional name of the elements to return.

    Returns LinqElements

  • Returns the content of this XContainer. Note that the content does not include XAttributes.

    Returns

    The content of this XContainer as an IterableOfXNode.

    Returns LinqNodes

  • remove(): void
  • Removes this XNode from the underlying XML tree.

    Returns void

  • removeNodes(): void
  • Removes the nodes from this XContainer. Note that this method does not remove the attributes.

    Returns void

  • removeNodesSkipNotify(): void
  • Returns void

  • replaceNodes(...content: any[]): void
  • Replaces the child nodes of this XContainer with the specified content. The content can be simple content, a collection of content objects, a param list of content objects, or null.

    Parameters

    • Rest ...content: any[]

      The new content.

    Returns void

  • replaceWith(...content: any[]): void
  • Replaces this node with the specified content.

    Parameters

    • Rest ...content: any[]

      Content that replaces this node.

    Returns void

  • toString(): string
  • Returns a string that represents the current object.

    Returns

    A string that represents the current object.

    Returns string

Generated using TypeDoc