pptx/extended-properties-basic--hyperlink-base

The ``docProps/app.xml`` part carries application-level metadata (Application, AppVersion, Company, Manager, PresentationFormat, HyperlinkBase, Template). Each case isolates one field, so each XPath assertion proves that particular field round-trips via python-pptx's Presentation.extended_properties API.

Library verdicts: python-pptx: — pptxjs: —

Metadata

Feature idpptx/extended-properties-basic--hyperlink-base
Formatpptx
Categorymetadata
Familypptx/extended-properties-basic
Axis valuesfield=hyperlink-base
Spececma-376-5-part-4 § 22.2

XPath assertions

ID / partPredicateXPathpython-pptxpptxjs
ext-hyperlink-base-present
docProps/app.xml
exist
The hyperlink-base element must be present in docProps/app.xml.
//ep:HyperlinkBase
ext-hyperlink-base-value
docProps/app.xml
equal = https://example.com/
The hyperlink-base element's text must equal the supplied value.
//ep:HyperlinkBase

Render assertions

No render assertions declared.

Generator source

scripts/gen_extended_properties_basic_pptx.py

#!/usr/bin/env python3
"""Generate ``fixtures/pptx/extended-properties-basic--<field>.pptx`` fixtures.

Parameterised generator; mirror of the docx / xlsx counterparts. Drives
``features/pptx/extended-properties-basic.json``.
"""

from __future__ import annotations

import argparse
import datetime as _dt
from pathlib import Path

from pptx import Presentation

_REPO_ROOT = Path(__file__).resolve().parent.parent
_REPRODUCIBLE_DT = _dt.datetime(2000, 1, 1, 0, 0, 0)

_PINNED_CREATED = _dt.datetime(2026, 1, 1, 0, 0, 0, tzinfo=_dt.timezone.utc)
_PINNED_MODIFIED = _dt.datetime(2026, 1, 2, 0, 0, 0, tzinfo=_dt.timezone.utc)


def _apply(prs, field: str, value: str) -> None:
    ep = prs.extended_properties
    if field == "application":
        ep.application = value
    elif field == "app-version":
        ep.app_version = value
    elif field == "company":
        ep.company = value
    elif field == "manager":
        ep.manager = value
    elif field == "presentation-format":
        ep.presentation_format = value
    elif field == "hyperlink-base":
        ep.hyperlink_base = value
    elif field == "template":
        ep.template = value
    else:
        raise SystemExit(f"Unknown field id: {field!r}")


def main() -> int:
    parser = argparse.ArgumentParser()
    parser.add_argument("--field", required=True)
    parser.add_argument("--value", required=True)
    parser.add_argument(
        "--out",
        default=str(_REPO_ROOT / "fixtures" / "pptx" / "extended-properties-basic.pptx"),
    )
    args = parser.parse_args()

    out_path = Path(args.out)
    if not out_path.is_absolute():
        out_path = _REPO_ROOT / out_path

    prs = Presentation()
    prs.slides.add_slide(prs.slide_layouts[6])
    # Pin core-props timestamps so only app.xml varies per case.
    prs.core_properties.created = _PINNED_CREATED
    prs.core_properties.modified = _PINNED_MODIFIED
    _apply(prs, args.field, args.value)
    out_path.parent.mkdir(parents=True, exist_ok=True)
    prs.save(out_path, zip_date_time=_REPRODUCIBLE_DT)
    print(out_path)
    return 0


if __name__ == "__main__":
    raise SystemExit(main())

Manifest (expanded)

{
  "$schema": "../manifest.schema.json",
  "id": "pptx/extended-properties-basic--hyperlink-base",
  "kind": "literal",
  "title": "Extended (app) properties: common scalar fields",
  "format": "pptx",
  "category": "metadata",
  "summary": "The ``docProps/app.xml`` part carries application-level metadata (Application, AppVersion, Company, Manager, PresentationFormat, HyperlinkBase, Template). Each case isolates one field, so each XPath assertion proves that particular field round-trips via python-pptx's Presentation.extended_properties API.",
  "spec": {
    "source": "ecma-376-5-part-4",
    "clause": "22.2",
    "notes": "ECMA-376 Part 4 / ISO 29500-4 section 22.2 defines the extended-properties part (``docProps/app.xml``). python-pptx exposes the scalar subset (Application, AppVersion, Company, Manager, HyperlinkBase, PresentationFormat, Template); the Slides count is auto-synced from the slide list at save-time (see python-pptx issue #131) so it is not included in this family. DocSecurity is not exposed by python-pptx and is omitted from this manifest."
  },
  "fixtures": {
    "machine": "pptx/extended-properties-basic--hyperlink-base"
  },
  "generator": {
    "python": "scripts/gen_extended_properties_basic_pptx.py",
    "arg_template": "--field {field.id} --value \"{field.value}\" --out fixtures/pptx/extended-properties-basic--{field.id}.pptx"
  },
  "_expansion": {
    "parent_id": "pptx/extended-properties-basic",
    "bindings": {
      "field": "hyperlink-base"
    }
  },
  "assertions": [
    {
      "id": "ext-hyperlink-base-present",
      "part": "docProps/app.xml",
      "namespaces": {
        "ep": "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
      },
      "xpath": "//ep:HyperlinkBase",
      "must": "exist",
      "description": "The hyperlink-base element must be present in docProps/app.xml."
    },
    {
      "id": "ext-hyperlink-base-value",
      "part": "docProps/app.xml",
      "namespaces": {
        "ep": "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
      },
      "xpath": "//ep:HyperlinkBase",
      "must": "equal",
      "value": "https://example.com/",
      "description": "The hyperlink-base element's text must equal the supplied value."
    }
  ]
}

Fixture

Download extended-properties-basic--hyperlink-base.pptx (27.3 KB)

Reference preview

No rendered reference is available for this case.

Spec notes

ECMA-376 Part 4 / ISO 29500-4 section 22.2 defines the extended-properties part (``docProps/app.xml``). python-pptx exposes the scalar subset (Application, AppVersion, Company, Manager, HyperlinkBase, PresentationFormat, Template); the Slides count is auto-synced from the slide list at save-time (see python-pptx issue #131) so it is not included in this family. DocSecurity is not exposed by python-pptx and is omitted from this manifest.