icalendar.parser.xcal.component module#

A parser for components.

class icalendar.parser.xcal.component.XCalComponentsParser(element, component_factory, types_factory)[source]#

Bases: XCalParser

A parser of an iCalendar stream or IC:components which contain component elements that yields Components.

Parameters:

Examples

element can be an iCalendar stream that contains one or more IC:vcalendar components.

<icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
  <vcalendar>
    ...
  </vcalendar>
</icalendar>

Components can contain other components inside the IC:components XML element. The parameter element can be such an IC:components XML element.

<components>
  <vevent>
    ...
  </vevent>
</components>
parse_component()[source]#

Convert one child into a Component.

Return type:

Component

Returns:

The parsed component.

Raises:

Example

The XML below shows the structure of one component element element that gets parsed by this method. vcalendar is the name of the component element. The XML below shows the structure of one component element that gets parsed by this method. vcalendar is the name of the component element. Each component element can contain an IC:properties and an IC:components element with more components.

<vcalendar>
  <properties>
    ...
  </properties>
  <components>
    <vevent>
    ...
    </vevent>
  </components>
</vcalendar>
parse_component_from_child()[source]#

Parse a component from a child element.

Return type:

Component

Returns:

The parsed component.

Raises: