Skip to content

PowerPoint2007 writer schema validation test case #307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Apr 10, 2017

Conversation

chriskapp
Copy link
Contributor

Hi, this adds a new schema test case which validates the produced XML from the PowerPoint2007
writer against the ECMA/ISO Office Open XML File Formats XSD. In the test (tests/PhpPresentation/Tests/Writer/PowerPoint2007/SchemaTest.php) we basically generate a ppt
based on the sample files and then check whether the generated XML is valid against the schema. This should help to protect us from generating the wrong format. Of course this test covers only the elements which are used but it is a start.

The test brought up an issue: Microsoft generates percentage values formatted as 1000th of a percent
but the standard requires it to be formatted with a trailing percent sign. I have adjusted the writer so that
the values are generated accordingly to the schema.
See: https://msdn.microsoft.com/en-us/library/gg548608(v=office.12).aspx

@@ -1457,8 +1457,6 @@ protected function writeParagraphs(XMLWriter $objWriter, $paragraphs, $bIsPlaceh
$objWriter->endElement();
}
}

$objWriter->endElement();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@k42b3 Why do you remove this ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@k42b3 That generates some errors in unit tests : https://travis-ci.org/PHPOffice/PHPPresentation/jobs/192111234#L353

# Conflicts:
#	src/PhpPresentation/Writer/PowerPoint2007/PptCharts.php
#	src/PhpPresentation/Writer/PowerPoint2007/PptSlides.php
#	tests/PhpPresentation/Tests/Writer/PowerPoint2007/PptSlidesTest.php
@Progi1984
Copy link
Member

@k42b3 Could you update the Changelog.md for adding your improvements, please ? Have you another modifications in this PR ?

@Progi1984 Progi1984 added this to the 0.9.0 milestone Apr 10, 2017
@chriskapp
Copy link
Contributor Author

Hi, ok I have updated the changelog. So basically it adds only the test case and changes percentage format.

@Progi1984 Progi1984 merged commit 3708462 into PHPOffice:develop Apr 10, 2017
@Progi1984
Copy link
Member

@k42b3 Very good job. I just merged it.

@chriskapp
Copy link
Contributor Author

Thats great, thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants