Open-XML-SDK: Schema Error : The attribute 'anchory' has invalid value 'line'. The Enumeration constraint failed.

Is this a:

  • Issue with the OpenXml library
  • Question on library usage

Description

Schema Error : The attribute ‘anchory’ has invalid value ‘line’. The Enumeration constraint failed. On 2 separate valid Office 365 Word documents.

Information

  • .NET Target: NET 4.6.2
  • DocumentFormat.OpenXml Version: 2.11.0

Repro

class Program
    {
        static void Main(string[] args)
        {
            OpenXmlPackage wordDocument1 = WordprocessingDocument.Open("BouwstenenAlle.docm", false);
            List<ValidationErrorInfo> errorInfos1 = ValidateDocument(wordDocument1);

            foreach (ValidationErrorInfo info in errorInfos1)
            {
                Console.WriteLine(string.Format("BouwstenenAlle.docm Error Occurred {0}", info.Description)); 
            }

            OpenXmlPackage wordDocument2 = WordprocessingDocument.Open("LettertypenAlle.docx", false);
            List<ValidationErrorInfo> errorInfos2 = ValidateDocument(wordDocument2);

            foreach (ValidationErrorInfo info in errorInfos2)
            {
                Console.WriteLine(string.Format("LettertypenAlle.docx Validaton Error Occurred {0}", info.Description));
            }

            Console.ReadKey();
        }

        static List<ValidationErrorInfo> ValidateDocument(OpenXmlPackage package)
        {
            OpenXmlValidator validator = new OpenXmlValidator(FileFormatVersions.Office2016);
            List<ValidationErrorInfo> validationErrors = validator.Validate(package).ToList();

            return validationErrors;
        }
    }

Observed

The following validation error was reported on both files.

Schema Error : The attribute ‘anchory’ has invalid value ‘line’. The Enumeration constraint failed.

Expected

Both files should have been validated successfully without the above error.

InvalidFiles2.zip

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 17 (5 by maintainers)

Commits related to this issue

Most upvoted comments

At this time no time is set. However, a number of API updates are on the docket, so probably within a month