mikeebowen / OOXML-Validator

A .NET CLI Package for validating Office Open XML files.
https://marketplace.visualstudio.com/items?itemName=mikeebowen.ooxml-validator-vscode
MIT License
20 stars 3 forks source link

Output XML #3

Closed Asbjoedt closed 2 years ago

Asbjoedt commented 2 years ago

Hello @mikeebowen

My organization uses XML and XML schemas for most of our workflows.

We would like to request the feature of having the validation errors optionally output in XML.

mikeebowen commented 2 years ago

Hi @Asbjoedt , I will work on this. It will have to be behind a flag like --xml , so it doesn't break current projects using the validator.

mikeebowen commented 2 years ago

@Asbjoedt ,

If we output xml with the strict format status from the CLI. Do you still need strict validation displayed displayed on the OOXML Validator VS Code extension?

Asbjoedt commented 2 years ago

@mikeebowen I cannot strictly say I need it, at this moment.

mikeebowen commented 2 years ago

Hi @Asbjoedt ,

Version 1.1.0 adds the ability to return xml with a --xml flag. You can download the executable for your system from the release page

To use the CLI call the executable for your system and pass in 3 arguments: the absolute path to the file (required), the Office version to validate against (Optional, defaults to Microsoft365), and the --xml flag (optional, defaults to JSON if omitted). To validate against the default Microsoft365 and return xml, you would use something like this:

OOXMLValidatorCLI.exe C:\absolute\path\to\file.docx --xml

Asbjoedt commented 2 years ago

Hi @mikeebowen `

Great, thank you a bunch!

If we want the validator to be able to bulk process all files recursively in a folder, do I need to open a new issue for this feature?

mikeebowen commented 2 years ago

Hi @Asbjoedt ,

Yes please create another issue for processing files in bulk. I should have some time this week to get started working on it.