Skip to content

Parser

Parses the XML Declaration

  • Full name: \SimplePie\XML\Declaration\Parser

Constants

Constant Visibility Type Value
STATE_BEFORE_VERSION_NAME private 'before_version_name'
STATE_VERSION_NAME private 'version_name'
STATE_VERSION_EQUALS private 'version_equals'
STATE_VERSION_VALUE private 'version_value'
STATE_ENCODING_NAME private 'encoding_name'
STATE_EMIT private 'emit'
STATE_ENCODING_EQUALS private 'encoding_equals'
STATE_STANDALONE_NAME private 'standalone_name'
STATE_ENCODING_VALUE private 'encoding_value'
STATE_STANDALONE_EQUALS private 'standalone_equals'
STATE_STANDALONE_VALUE private 'standalone_value'
STATE_ERROR private false

Properties

version

XML Version

public string $version

encoding

Encoding

public string $encoding

standalone

Standalone

public bool $standalone

state

Current state of the state machine

public self::STATE_* $state

data

Input data

public string $data

data_length

Input data length (to avoid calling strlen() everytime this is needed)

public int $data_length

position

Current position of the pointer

public int $position

Methods

__construct

Create an instance of the class with the input data

public __construct(string $data): mixed

Parameters:

Parameter Type Description
$data string Input data

parse

Parse the input data

public parse(): bool

Return Value:

true on success, false on failure


has_data

Check whether there is data beyond the pointer

public has_data(): bool

Return Value:

true if there is further data, false if not


skip_whitespace

Advance past any whitespace

public skip_whitespace(): int

Return Value:

Number of whitespace characters passed


get_value

Read value

public get_value(): mixed

before_version_name

public before_version_name(): mixed

version_name

public version_name(): mixed

version_equals

public version_equals(): mixed

version_value

public version_value(): mixed

encoding_name

public encoding_name(): mixed

encoding_equals

public encoding_equals(): mixed

encoding_value

public encoding_value(): mixed

standalone_name

public standalone_name(): mixed

standalone_equals

public standalone_equals(): mixed

standalone_value

public standalone_value(): mixed


Automatically generated on 2025-03-18