Timing writer emits p:animScale / p:animClr value children out of ECMA-376 sequence

未关闭 适合新手
#646 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
testing

调研方向

从 sdpm/sdpm/engine/timing/writer.py 和 tests/test_animation_writer.py 入手;将为 p:animScale 和 p:animClr 输出的值子元素顺序与 issue 中给出的 ECMA-376 顺序进行比较。添加测试,根据这些顺序验证生成的 timing XML,同时保持 reader 对两种顺序都能容忍。完成标准是 writer 按 schema 顺序输出,且测试对此进行验证。

由索引模型根据 Issue 内容生成。

描述

The timing writer appends the value children of p:animScale (and p:animClr) as to, from, by, tavLst (sdpm/sdpm/engine/timing/writer.py, introduced in #595). ECMA-376 declares them as an xsd:sequence: CT_TLAnimateScaleBehavior is cBhvr, by?, from?, to?, and p:animClr has the same order. A generated entrance.curveUp therefore carries cBhvr, to, from, which a strict validator rejects.

PowerPoint's parser accepts the out-of-sequence order, so nothing fails today. Since #595 makes the reader compare those children by element name, a PowerPoint file written in sequence order now imports as semantic JSON and is regenerated out of sequence.

The suite has no schema validation of generated timing XML. tests/test_animation_writer.py states that the writer never emits a schema-invalid node, but it checks element order only at the p:timing insertion point.

Proposed scope:

  • Emit the value children in schema order.
  • Add a test that validates generated timing XML against the ECMA-376 sequence for the behaviour elements the writer emits.

This changes generated bytes, so the reader should keep accepting both orders.

Raised in the #595 review: https://github.com/aws-samples/sample-spec-driven-presentation-maker/pull/595

主要语言
Python
星标
136
派生
13
平均合并
7 小时 43 分钟
30 天内合并 PR
180

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

aws-samples/sample-spec-driven-presentation-maker 的其他 Issue

查看 aws-samples/sample-spec-driven-presentation-maker 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。