question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
twsouthwickcommented, Jul 13, 2020

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

0reactions
06needhamtcommented, Nov 2, 2020

Going to close this issue as I am satisfied with the responses. Feel free to reopen if necessary

Read more comments on GitHub >

github_iconTop Results From Across the Web

Schema Error : The attribute 'anchory' has invalid value ' ...
The Enumeration constraint failed. On 2 separate valid Office 365 Word documents. ... The following validation error was reported on both files.
Read more >
How can I fix "the Enumeration constraint failed"?
The following error messages appear in the Web.config file: The 'contract' attribute is invalid - The value 'SandwichServices.CostService' is ...
Read more >
Enumeration constraint failed error occurs when creating a ...
Error occurs when you open a previously saved map: enumeration constraint failed.
Read more >
Understanding schema errors
The schema is defined by the XSD. Schema errors occur where there is a problem with the structure or order of the file,...
Read more >
Management agent run error codes
This error is returned by the management agents for LDAP and Windows NT 4.0 when the value for an attribute violates certain value...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found