Comments (18)
As far as I know, none of the errors are benign. "Sch_InvalidElementContentExpectingComplex" indicates that an element has invalid content, which likely would cause the whole document to be invalid. I contribute to another extension that allows viewing, editing, change tracking etc. for OOXML files. It could help view the underlying xml and see what the invalid content is.
https://marketplace.visualstudio.com/items?itemName=yuenm18.ooxml-viewer
from ooxml-validator-vscode.
You shouldn't need to install .Net 6.0, but it won't hurt either. If you have the .NET Install Tool for Extension Authors installed then if you don't set any value for ooxml.dotNetPath
the extension will download the runtime itself, although this takes longer than if you have it on your system.
The file you need for the absolute path is dotnet.exe. Where it is will vary depending on your OS and setup. I'm using Windows 11 and my path is "C:\\Users\\<username>\\AppData\\Roaming\\Code\\User\\globalStorage\\ms-dotnettools.vscode-dotnet-runtime\\.dotnet\\3.1.23\\dotnet.exe"
.
from ooxml-validator-vscode.
Thank you for your help. I'm still having problems. Tried on a different PC hoping to have better luck. Both Windows machines. The following appears when I attempt to use the Validate OOXML feature in VS Code.
from ooxml-validator-vscode.
Does it work if you don't add ooxml.dotNetPath
?
From the error it looks like it's looking for a different version of .Net. Have you tried installing the .Net version from the link in the error?
from ooxml-validator-vscode.
On the other PC where I just tried a fresh install of the extension, I do not have the ooxml.dotNetPath entered in settings.
It's hard to tell from the error message what URL it's directing me to. On the first PC, I tried installing this runtime, but that didn't help:
https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-6.0.2-windows-x64-installer
Thanks again.
from ooxml-validator-vscode.
What is the result of running dotnet --list-runtimes
from PowerShell?
from ooxml-validator-vscode.
On the first PC:
Microsoft.NETCore.App 3.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
On the 2nd PC:
Microsoft.NETCore.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
from ooxml-validator-vscode.
Does "C:\Program Files\dotnet\dotnet.exe" exist on your PC?
If it does, try setting "ooxml.dotNetPath": "C:\\Program Files\\dotnet\\dotnet.exe"
. in your settings.json.
from ooxml-validator-vscode.
On the first PC, after making that change, I see the following error when I attempt to validate OOXML:
On the "clean" 2nd PC where I tried installing this morning, that change did help. Thank you! I will reboot the first PC to see if that makes any difference and will report back.
from ooxml-validator-vscode.
I'm glad you got it working at least on one PC! When you get the error, are you trying to use the validator on a .csv file?
from ooxml-validator-vscode.
It turns out I had set an absolute path of "C:\Temp" for the output file path. I cleared that setting and it is running the validation successfully now. Thank you!
Now that I have it working, is there any guidance on how to interpret or filter out the validation errors? I realize that some of the errors such as "Sch_InvalidElementContentExpectingComplex" are most likely benign. I am hoping to use the tool to determine the cause of certain DOCX files not being able to open in Word due to malformed OOXML, so I need to be able to sift out the benign warnings and if possible find the one piece of bad OOXML that causes the document to not open in Word.
from ooxml-validator-vscode.
Thanks. For the output file path, what would you suggest? Using C:\Temp caused an error previously, so do I need to create a blank .csv file so the absolute path includes a file name?
from ooxml-validator-vscode.
You don't need to create the file first, it just needs to be in a folder that VS Code can write to. As long as VS Code has write access it should work. Here's how you change folder permissions:
from ooxml-validator-vscode.
Thank you - adding a csv file name to the absolute path worked fine. Appreciate all your help!!!
from ooxml-validator-vscode.
Awesome! Since it's working for you, I'll go ahead and close this issue 😃
from ooxml-validator-vscode.
@mikeebowen This issue still seems to be present. My computer is an Ubuntu machine, so I installed VSCode, https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.vscode-dotnet-runtime and this validator on a clean VirtualBox Windows 10. And it gave me the same error about the wrong version being loaded.
from ooxml-validator-vscode.
@johanneswilm Does it work if you set ooxml.dotNetPath
?
from ooxml-validator-vscode.
@mikeebowen Yes, I got it to work by manually installing version 6.0.0 and then setting the setting.
The point is that the instructions don't work as it will install version 3.2.1 of the .net runtime and then subsequently throw an error about needing version 6.0.0.
from ooxml-validator-vscode.
Related Issues (12)
- Strict Validation HOT 11
- The error is unhelpful if the .net runtime extension is not installed
- Error Validating Word 2007 File HOT 9
- Troubleshooting running HOT 5
- Trouble running the ooxml-validator-vscode HOT 7
- Commas in certain values fails validation HOT 3
- Update OOXML SDK to 3.0 HOT 1
- List of possible elements expected is ommited
- Can't open file HOT 6
- Can you add a configuration that specifies the dotnet path HOT 3
- Allow validation of OOXML macro-enabled and add-in files HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ooxml-validator-vscode.