Adds a child node
public function addChild ( ?NodeInterface $child )Adds multiple child nodes
public function addChildren ( ...$children )Returns the parent node
public function getParent ( ) : ? NodeReturns the first child node of a given type
public function getFirstChildNode ( ...$types )Returns the first token of a given kind See: TokenKind class
public function getFirstToken ( ...$kinds )Returns all child nodes of a given type
public function getChildNodesOfType ( ...$types )Returns all child tokens of a given kind See: TokenKind class
public function getChildTokensOfType ( ...$kinds )Walks through all descendant nodes and tokens
public function walkDescendantNodesAndTokens ( callable $callback )Walks through all descendant nodes
public function walkDescendantNodes ( callable $callback )Walks through all descendant tokens
public function walkDescendantTokens ( callable $callback )Returns the root node. Will return self if node has no parent
public function getRoot ( ) : NodeReturns all child nodes and tokens
public function getChildNodesAndTokens ( )Returns all child nodes
public function getChildNodes ( )Returns all child tokens
public function getChildTokens ( )public function getTokenAtOffset ( int $offset )JSON serialize node for debugging purposes
public function jsonSerialize ( ) : mixedReturns the prolog node
public function getProlog ( ) : ? PrologReturns the root element node
public function getRootElement ( ) : ? ElementReturns the misc node
public function getMisc ( ) : arrayReturns the element name as string. Returns null if NAME token is not found
public function getName ( ) : ? stringReturns all element attribute nodes
public function getAttributes ( ) : arrayReturns the content node
public function getContent ( ) : ? ContentReturns all child element nodes
public function getElements ( ) : arrayReturns all child reference nodes
public function getReferences ( ) : arrayReturns all child charData nodes
public function getCharData ( ) : arrayReturns all CData strings
public function getCData ( ) : arrayReturns all comment strings
public function getComments ( ) : arrayReturns the attribute name as string. Returns null if NAME token is not found
public function getName ( ) : ? stringReturns the attribute value as string (without quotes) Returns null if STRING token is not found
public function getValue ( ) : ? stringReturns the attribute value as string (with quotes) Returns null if STRING token is not found
public function getFullValue ( ) : ? stringReturns the text content of the node. Does not include whitesspace
public function getText ( ) : ? stringReturns all child attribute nodes
public function getAttributes ( ) : arrayReturns the entity reference as string.
public function getEntityRef ( ) : ? stringReturns the character reference as string.
public function getCharRef ( ) : ? stringpublic function __construct ( )Parses an XML string into a Document node
public function parse ( string $xml ) : Node\Documentpublic function __construct ( )Splits raw XML string into tokens
public function tokenize ( string $input )public function __construct ( int $kind,
string $fullValue,
string $value,
int $offset,
int $fullOffset, )JSON serialize token for debugging purposes
public function jsonSerialize ( ) : mixed