8000 How to get multiple validation errors with line numbers? · Issue #19 · jameslan/libxml2-wasm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
How to get multiple validation errors with line numbers? #19
Closed
@renkei

Description

@renkei

First of all, great project, thanks a lot! The runtime plugin approach is always an issue. Either newer Node.js versions are not supported see #660 or there are no updated prebuilt binaries available or the prebuilt binaries are not compatible with the Electron version you want to use, etc. There are many reasons, why this can cause trouble again and again... depending on your environment.

To compile libxml2 to WebAssembly is really a nice idea and solves all issues above. Great!

Now the issue:
When I run the validation, I can see all validation errors as console output of libxml2-wasm, including the line number, but the error I can catch if I put the validate method in a try/catch block as you propose in your example, seems to contain only the last error and only the message without line number.

It would be helpful, if the validator would have a property, let's say validationErrors of type Array<XmlValidateError> that contains all validationErrors of the last run. XmlValidateError should then have beside property message also a property lineNumber.

What do you think? Or is there already a possibility to get all errors via API?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0