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:
vUriAn 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
vUriinstance.This method overrides
str.__new__()because URI values inherit fromstr, 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 throughto_unicode().encoding – Encoding used when
valueisbytes.params (
Parameters) – Optional property parameters according to RFC 5545.
- Returns:
A new
vUriinstance 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'
- 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
Noneif no valid x-pointer is found.