XML
extends Parser
in package
XML Parser.
This parser parses both the xCal and xCard formats.
Tags
Table of Contents
- OPTION_FORGIVING = 1
- Turning on this option makes the parser more forgiving.
- OPTION_IGNORE_INVALID_LINES = 2
- If this option is turned on, any lines we cannot parse will be ignored by the reader.
- XCAL_NAMESPACE = 'urn:ietf:params:xml:ns:icalendar-2.0'
- XCARD_NAMESPACE = 'urn:ietf:params:xml:ns:vcard-4.0'
- $input : array<string|int, mixed>
- The input data.
- $options : int
- Bitmask of parser options.
- $root : Document
- Document, root component.
- $pointer : array<string|int, mixed>
- A pointer/reference to the input.
- __construct() : mixed
- Creates the parser.
- parse() : Document
- Parse xCal or xCard.
- setInput() : mixed
- Sets the input data.
- createProperty() : mixed
- Create a property.
- getTagName() : string
- Get tag name from a Clark notation.
- parseComponent() : mixed
- Parse a component.
- parseProperties() : mixed
- Parse xCalendar and xCard properties.
- parseVCalendarComponents() : mixed
- Parse a xCalendar component.
- parseVCardComponents() : mixed
- Parse a xCard component.
Constants
OPTION_FORGIVING
Turning on this option makes the parser more forgiving.
public
mixed
OPTION_FORGIVING
= 1
In the case of the MimeDir parser, this means that the parser will accept slashes and underscores in property names, and it will also attempt to fix Microsoft vCard 2.1's broken line folding.
OPTION_IGNORE_INVALID_LINES
If this option is turned on, any lines we cannot parse will be ignored by the reader.
public
mixed
OPTION_IGNORE_INVALID_LINES
= 2
XCAL_NAMESPACE
public
mixed
XCAL_NAMESPACE
= 'urn:ietf:params:xml:ns:icalendar-2.0'
XCARD_NAMESPACE
public
mixed
XCARD_NAMESPACE
= 'urn:ietf:params:xml:ns:vcard-4.0'
Properties
$input
The input data.
protected
array<string|int, mixed>
$input
$options
Bitmask of parser options.
protected
int
$options
$root
Document, root component.
protected
Document
$root
$pointer
A pointer/reference to the input.
private
array<string|int, mixed>
$pointer
Methods
__construct()
Creates the parser.
public
__construct([mixed $input = null ], int $options) : mixed
Optionally, it's possible to parse the input stream here.
Parameters
- $input : mixed = null
- $options : int
-
any parser options (OPTION constants)
Return values
mixed —parse()
Parse xCal or xCard.
public
parse([resource|string $input = null ], int $options) : Document
Parameters
- $input : resource|string = null
- $options : int
Tags
Return values
Document —setInput()
Sets the input data.
public
setInput(resource|string $input) : mixed
Parameters
- $input : resource|string
Return values
mixed —createProperty()
Create a property.
protected
createProperty(Component $parentComponent, string $name, array<string|int, mixed> $parameters, string $type, mixed $value) : mixed
Parameters
- $parentComponent : Component
- $name : string
- $parameters : array<string|int, mixed>
- $type : string
- $value : mixed
Return values
mixed —getTagName()
Get tag name from a Clark notation.
protected
static getTagName(string $clarkedTagName) : string
Parameters
- $clarkedTagName : string
Return values
string —parseComponent()
Parse a component.
protected
parseComponent(Component $parentComponent) : mixed
Parameters
- $parentComponent : Component
Return values
mixed —parseProperties()
Parse xCalendar and xCard properties.
protected
parseProperties(Component $parentComponent[, string $propertyNamePrefix = '' ]) : mixed
Parameters
- $parentComponent : Component
- $propertyNamePrefix : string = ''
Return values
mixed —parseVCalendarComponents()
Parse a xCalendar component.
protected
parseVCalendarComponents(Component $parentComponent) : mixed
Parameters
- $parentComponent : Component
Return values
mixed —parseVCardComponents()
Parse a xCard component.
protected
parseVCardComponents(Component $parentComponent) : mixed
Parameters
- $parentComponent : Component