Giter Site home page Giter Site logo

Comments (18)

mikeebowen avatar mikeebowen commented on May 22, 2024 1

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.

mikeebowen avatar mikeebowen commented on May 22, 2024

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.

kew-dev avatar kew-dev commented on May 22, 2024

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.
image

from ooxml-validator-vscode.

mikeebowen avatar mikeebowen commented on May 22, 2024

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.

kew-dev avatar kew-dev commented on May 22, 2024

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.

mikeebowen avatar mikeebowen commented on May 22, 2024

What is the result of running dotnet --list-runtimes from PowerShell?

from ooxml-validator-vscode.

kew-dev avatar kew-dev commented on May 22, 2024

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.

mikeebowen avatar mikeebowen commented on May 22, 2024

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.

kew-dev avatar kew-dev commented on May 22, 2024

On the first PC, after making that change, I see the following error when I attempt to validate OOXML:

image

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.

mikeebowen avatar mikeebowen commented on May 22, 2024

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.

kew-dev avatar kew-dev commented on May 22, 2024

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.

kew-dev avatar kew-dev commented on May 22, 2024

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.

mikeebowen avatar mikeebowen commented on May 22, 2024

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:

https://learn.microsoft.com/en-us/answers/questions/696965/windows-11-folder-read-amp-write-permissions-don39.html

from ooxml-validator-vscode.

kew-dev avatar kew-dev commented on May 22, 2024

Thank you - adding a csv file name to the absolute path worked fine. Appreciate all your help!!!

from ooxml-validator-vscode.

mikeebowen avatar mikeebowen commented on May 22, 2024

Awesome! Since it's working for you, I'll go ahead and close this issue 😃

from ooxml-validator-vscode.

johanneswilm avatar johanneswilm commented on May 22, 2024

@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.

mikeebowen avatar mikeebowen commented on May 22, 2024

@johanneswilm Does it work if you set ooxml.dotNetPath?

from ooxml-validator-vscode.

johanneswilm avatar johanneswilm commented on May 22, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.