Quantcast
Channel: Open XML Format SDK forum
Viewing all articles
Browse latest Browse all 1288

Attempting to validate OpenXML documents created in Word produces errors

$
0
0

I am doing some research which includes needing to validate a set of collected OpenXML documents. I am using DocumentFormat.OpenXml.Validation in C#, and I am attempting to understand why validation of some of the documents produce errors even though they appear to be created in Word.

For each document, I specify DocumentFormat.OpenXml.FileFormatVersions.Office2007, DocumentFormat.OpenXml.FileFormatVersions.Office2010 and DocumentFormat.OpenXml.FileFormatVersions.Office2013 when handling them, as the documents may have been created with any of those three versions of Office. For some documents, performing validation produces no errors when using the correct FileFormatVersions. For other documents, however, there are errors no matter which I use. Example:

app.xml in file says:

<Application>Microsoft Office Word</Application>
<AppVersion>12.0000</AppVersion>

Validating as 2007/2010/2013 all produce the following three errors:
The element has invalid child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:smartTag'.
The element has invalid child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:smartTag'.
The element has invalid child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:smartTagType'.

Any ideas? I don't quite get why Office would produce invalid documents.


Viewing all articles
Browse latest Browse all 1288

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>