Skip to content

Non-standard but schema-valid rId values raise exception on #3

scanny opened this Issue Feb 12, 2013 · 1 comment

1 participant

scanny commented Feb 12, 2013

Jasper Reports, and perhaps other PresentationML generators, produce relationship id values, some of which do not follow the PowerPoint® client convention of 'rId%d'. In this particular case, the relationship ids included 'rIdSm' for the slide master. A ValueError was thrown in _Relationship._num when this value was encountered.

@scanny scanny was assigned Feb 12, 2013
@scanny scanny added a commit that referenced this issue Feb 12, 2013
@scanny fix issue #3: non-standard rId raises exception
* add try/except block to _Relationship._num to apply numeric value of
9999 to non-standard rIds. This results in those relationships being
sorted to an arbitrary position at the end of the list, behind
relationships with conformant rId values.

* comment out _reltype_ordering assignment in Presentation._load to
prevent presentation rIds from being renumbered, as renumbering was
causing inconsistency between slide master rId stored in
presentation.xml <p:sldMasterIdLst>

* factor __rewrite_sldIdLst() out to a helper method to clarify intent
in Presentation._blob

Full fix would require adding element rewriting code for all four
relationship lists in presentation.xml in Presentation._blob. That
effort is postponed until support is added for manipulating
slideMaster, notesMaster, and/or handoutMaster parts.
scanny commented Feb 12, 2013

Close inspection of the relevant schema reveals that rId values may be arbitrary xsd:ID strings, starting with a letter or underscore and containing only letters, digits, underscores, periods, and dashes. Renumbering of relationship ids was commented out for now and non-standard rIds are preserved intact through the open() to save() cycle.

@scanny scanny closed this Feb 12, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.