Skip to content

XML

XML Parser.

This parser parses both the xCal and xCard formats.

Constants

Constant Visibility Type Value
XCAL_NAMESPACE public 'urn:ietf:params:xml:ns:icalendar-2.0'
XCARD_NAMESPACE public 'urn:ietf:params:xml:ns:vcard-4.0'

Properties

input

The input data.

protected array $input

pointer

A pointer/reference to the input.

private array $pointer

root

Document, root component.

protected \Sabre\VObject\Document $root

Methods

__construct

Creates the parser.

public __construct(mixed $input = null, int $options): mixed

Optionally, it's possible to parse the input stream here.

Parameters:

Parameter Type Description
$input mixed
$options int any parser options (OPTION constants)

parse

Parse xCal or xCard.

public parse(resource|string $input = null, int $options): \Sabre\VObject\Document

Parameters:

Parameter Type Description
$input resource|string
$options int

Throws:


parseVCalendarComponents

Parse a xCalendar component.

protected parseVCalendarComponents(\Sabre\VObject\Component $parentComponent): mixed

Parameters:

Parameter Type Description
$parentComponent \Sabre\VObject\Component

parseVCardComponents

Parse a xCard component.

protected parseVCardComponents(\Sabre\VObject\Component $parentComponent): mixed

Parameters:

Parameter Type Description
$parentComponent \Sabre\VObject\Component

parseProperties

Parse xCalendar and xCard properties.

protected parseProperties(\Sabre\VObject\Component $parentComponent, string $propertyNamePrefix = ''): mixed

Parameters:

Parameter Type Description
$parentComponent \Sabre\VObject\Component
$propertyNamePrefix string

parseComponent

Parse a component.

protected parseComponent(\Sabre\VObject\Component $parentComponent): mixed

Parameters:

Parameter Type Description
$parentComponent \Sabre\VObject\Component

createProperty

Create a property.

protected createProperty(\Sabre\VObject\Component $parentComponent, string $name, array $parameters, string $type, mixed $value): mixed

Parameters:

Parameter Type Description
$parentComponent \Sabre\VObject\Component
$name string
$parameters array
$type string
$value mixed

setInput

Sets the input data.

public setInput(resource|string $input): mixed

Parameters:

Parameter Type Description
$input resource|string

getTagName

Get tag name from a Clark notation.

protected static getTagName(string $clarkedTagName): string
  • This method is static.

Parameters:

Parameter Type Description
$clarkedTagName string

Inherited methods

__construct

Creates the parser.

public __construct(mixed $input = null, int $options): mixed

Optionally, it's possible to parse the input stream here.

Parameters:

Parameter Type Description
$input mixed
$options int any parser options (OPTION constants)

parse

This method starts the parsing process.

public parse(mixed $input = null, int $options): array

If the input was not supplied during construction, it's possible to pass it here instead.

If either input or options are not supplied, the defaults will be used.

  • This method is abstract.

Parameters:

Parameter Type Description
$input mixed
$options int

setInput

Sets the input data.

public setInput(mixed $input): mixed
  • This method is abstract.

Parameters:

Parameter Type Description
$input mixed


Automatically generated on 2025-03-18