icalendar.prop.xml_reference module#

XML-REFERENCE values from RFC 9253.

class icalendar.prop.xml_reference.vXmlReference(value: str, encoding: str = 'utf-8', /, params: dict[str, Any] | None = None)[source]#

Bases: vUri

An XML-REFERENCE.

The associated value references an associated XML artifact and is a URI with an XPointer anchor value.

This is defined in RFC 9253, Section 7.

Create a new vUri instance.

This method overrides str.__new__() because URI values inherit from str, which is immutable. The __new__ method decodes bytes if needed, creates the string instance, and attaches iCalendar property parameters.

Parameters:
  • value – URI string or bytes decoded with encoding, passed through to_unicode().

  • encoding – Encoding used when value is bytes.

  • params (Parameters) – Optional property parameters according to RFC 5545.

Returns:

A new vUri instance with associated parameters.

Examples

>>> from icalendar import vUri
>>> u = vUri(
...     "http://example.com/agenda.doc",
...     params={"VALUE": "URI"},
... )
>>> u.uri
'http://example.com/agenda.doc'
>>> u.params["VALUE"]
'URI'
default_value: ClassVar[str] = 'XML-REFERENCE'#
classmethod examples()[source]#

Examples of vXmlReference.

Return type:

list[None]

params: Parameters#
property x_pointer: str | None#

The XPointer of the URI.

The XPointer is defined in W3C.WD-xptr-xpointer-20021219, and its use as an anchor is defined in W3C.REC-xptr-framework-20030325.

Returns:

The decoded x-pointer or None if no valid x-pointer is found.

property xml_reference: str#

The XML reference URI of this property.