thatidiotguy
thatidiotguy

Reputation: 9011

Open Office XML Parsing Error

I am attempting to create a pptx file programmatically. However, when I try to open my pptx file, I receive very generic errors from LibreOffice and also from Microsoft PowerPoint. How can I go about getting more specific error information so I can find out what I am doing wrong in the underlying XML?

I am using PHP to create these files, not anything on the Microsoft stack by the way.

Upvotes: 2

Views: 234

Answers (2)

petelids
petelids

Reputation: 12815

The OpenXML Productivity Tool has a Validate action on it which will list any errors you may have. You can choose whether to validate against the 2007, 2010 or 2013 formats.

The following is an example where I've added an extra cell element outside of a row:

enter image description here

The tool also has a useful feature to allow you to generate code from an existing document. This can be extremely handy if you're stuck on how to generate a particular feature.

Upvotes: 1

kjhughes
kjhughes

Reputation: 111775

Download the OOXML PresentationML XSD, pml.xsd, from the Standard ECMA-376. You can find it in the zip at the link marked, ECMA-376 4th edition Part 1 in the OfficeOpenXML-XMLSchema-Strict.zip file. (There are also RELAX NG schemas available as well.)

Using Xerces or any other standard, validating XML parser should provide you with good diagnostic messages when the OOXML you generate is invalid.

Upvotes: 1

Related Questions