OpenXML Filter: Merge issue of DrawingML namespace of Property `lang` in Element `<a:rPr>`

Create issue
Issue #957 resolved
hao created an issue

Hi Okapi:

we have a PPTX file with DrawingML namespace contains an Element like <a:rPr lang="en-US" dirty="0"'>, when it’s merged it will be separated to two elements <a:rPr> and an invalid element <a:lang>. But since <a:lang> is invalid, Okapi can’t parse the result file.

Original:

<a:r>
    <a:rPr lang="en-US" dirty="0"/>
    <a:t>Post-editing effort comparison SMT and NMT</a:t>
 </a:r>

After translated:

<a:r>
    <a:rPr>
        <a:rtl/>
        <a:lang a:bidi="he-IL"/>
    </a:rPr>
    <a:t>השוואת מאמץ אחרי עריכה SMT ו-NMT</a:t>
</a:r>

<a:lang> is an invalid Element, thus Okapi can't parse the translated file.

Stack trace when parsing the translated file:

java.util.NoSuchElementException: null
    at java.util.AbstractList$Itr.next(AbstractList.java:377) ~[?:?]
    at net.sf.okapi.filters.openxml.RunProperties.alignWith(RunProperties.java:193) ~[okapi-filter-openxml-1.39.0.jar:?]
    at net.sf.okapi.filters.openxml.ParagraphBlockProperties$Drawing.updateProperty(ParagraphBlockProperties.java:153) ~[okapi-filter-openxml-1.39.0.jar:?]
    at net.sf.okapi.filters.openxml.ParagraphBlockProperties$Drawing.refine(ParagraphBlockProperties.java:139) ~[okapi-filter-openxml-1.39.0.jar:?]
    at net.sf.okapi.filters.openxml.StyleOptimisation$Default.applyTo(StyleOptimisation.java:104) ~[okapi-filter-openxml-1.39.0.jar:?]
    at net.sf.okapi.filters.openxml.Block.optimiseStyles(Block.java:126) ~[okapi-filter-openxml-1.39.0.jar:?]
    at net.sf.okapi.filters.openxml.StyledTextPart.process(StyledTextPart.java:246) ~[okapi-filter-openxml-1.39.0.jar:?]
    at net.sf.okapi.filters.openxml.StyledTextPart.open(StyledTextPart.java:198) ~[okapi-filter-openxml-1.39.0.jar:?]
    at net.sf.okapi.filters.openxml.StyledTextPart.open(StyledTextPart.java:128) ~[okapi-filter-openxml-1.39.0.jar:?]
    at net.sf.okapi.filters.openxml.OpenXMLFilter.nextInDocument(OpenXMLFilter.java:446) ~[okapi-filter-openxml-1.39.0.jar:?]
    at net.sf.okapi.filters.openxml.OpenXMLFilter.next(OpenXMLFilter.java:256) ~[okapi-filter-openxml-1.39.0.jar:?]
    at net.sf.okapi.filters.openxml.OpenXMLFilter.next(OpenXMLFilter.java:265) ~[okapi-filter-openxml-1.39.0.jar:?]
    at net.sf.okapi.steps.common.RawDocumentToFilterEventsStep.handleEvent(RawDocumentToFilterEventsStep.java:166) ~[okapi-step-common-1.39.0.jar:?]
    at net.sf.okapi.common.pipeline.Pipeline.execute(Pipeline.java:117) ~[okapi-core-1.39.0.jar:?]
    at net.sf.okapi.common.pipeline.Pipeline.process(Pipeline.java:227) ~[okapi-core-1.39.0.jar:?]
    at net.sf.okapi.common.pipeline.Pipeline.process(Pipeline.java:199) ~[okapi-core-1.39.0.jar:?]
    at net.sf.okapi.common.pipelinedriver.PipelineDriver.processBatch(PipelineDriver.java:182) ~[okapi-core-1.39.0.jar:?]

Please have a look and if you need any further information just let me know. Thank you for your great job!

Hao

Comments (7)

  1. hao reporter

    Hi Deins,

    Thank you for your response, I’m not pretty sure if it’s a same issue as I also try to translate the original file from en to ar-SA, and the issue doesn’t appeared.

    Following is the same section for ar-SA

    <a:r>
        <a:rPr>
            <a:rtl/>
        </a:rPr>
        <a:t>مقارنة جهود التحرير اللاحق SMT وNMT</a:t>
    </a:r>
    

    For better comparison I copy he-IL here:

    <a:r>
        <a:rPr>
            <a:rtl/>
            <a:lang a:bidi="he-IL"/>
        </a:rPr>
        <a:t>השוואת מאמץ אחרי עריכה SMT ו-NMT</a:t>
    </a:r>
    

  2. Denis Konovalyenko

    Hao, I can confirm that the mentioned issue #927 is intended to cover all RTL related problems for PPTX documents.

    Firstly, the a:defPPr rtl=”1” has to appear when a target document is written in one of RTL languages. Secondly, the currently available <a:rPr> > <a:rtl/> has to be removed. And thirdly, the <a:rPr> > <a:lang> has to be removed or substituted by <a:rPr lang="">.

  3. hao reporter

    Hi Deins, thank you for your detailed explanation! This issue can be closed in this case.

    Didn’t mean to push you, just need to inform my team, do you have any plans on when this will be fixed?

  4. Denis Konovalyenko

    Hi Hao,

    Most likely, issue #927, and this one as well, will be addressed in the next release (1.41). By the way, I think you will get a notification as soon as it is resolved.

    Thank you!

  5. Log in to comment