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: —
| Feature id | pptx/extended-properties-basic--app-version |
|---|---|
| Format | pptx |
| Category | metadata |
| Family | pptx/extended-properties-basic |
| Axis values | field=app-version |
| Spec | ecma-376-5-part-4 § 22.2 |
| ID / part | Predicate | XPath | python-pptx | pptxjs |
|---|---|---|---|---|
ext-app-version-presentdocProps/app.xml | existThe app-version element must be present in docProps/app.xml. | //ep:AppVersion | — | — |
ext-app-version-valuedocProps/app.xml | equal = 16.0000The app-version element's text must equal the supplied value. | //ep:AppVersion | — | — |
No render assertions declared.
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())
{
"$schema": "../manifest.schema.json",
"id": "pptx/extended-properties-basic--app-version",
"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--app-version"
},
"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": "app-version"
}
},
"assertions": [
{
"id": "ext-app-version-present",
"part": "docProps/app.xml",
"namespaces": {
"ep": "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
},
"xpath": "//ep:AppVersion",
"must": "exist",
"description": "The app-version element must be present in docProps/app.xml."
},
{
"id": "ext-app-version-value",
"part": "docProps/app.xml",
"namespaces": {
"ep": "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
},
"xpath": "//ep:AppVersion",
"must": "equal",
"value": "16.0000",
"description": "The app-version element's text must equal the supplied value."
}
]
}
No rendered reference is available for this case.