You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should be alerting the end user to parser errors and provide details as most applications do this (and silent errors like this are quite confusing).
I believe if there are errors, a node, parsererror is created under the root node.
For the above file (in Chrome) this is:
<parsererrorxmlns="http://www.w3.org/1999/xhtml"style="display: block; white-space: pre; border: 2px solid #c77; padding: 0 1em 0 1em; margin: 1em; background-color: #fdd; color: black"><h3>This page contains the following errors:</h3><divstyle="font-family:monospace;font-size:12px">error on line 157499 at column 206: Namespace prefix esld for x on IED is not defined
</div><h3>Below is a rendering of the page up to the first error.</h3></parsererror>
If we just use textContent we would get something like:
This page contains the following errors:error on line 157499 at column 206: Namespace prefix esld for x on IED is not defined\nBelow is a rendering of the page up to the first error.
Arguably if the file isn't valid XML we should just barf and refuse to open/process it but I think warning the end user would be better.
A more complete answer might be as described here but I think this might be excessive (?).
The text was updated successfully, but these errors were encountered:
Currently if the parser produces errors when opening a file they are not conveyed to the end-user.
For instance the attached file produces an error and only one IED exists because there is a missing namespace declaration.
XAT_BusA_P1.cid.zip
We should be alerting the end user to parser errors and provide details as most applications do this (and silent errors like this are quite confusing).
I believe if there are errors, a node,
parsererror
is created under the root node.For the above file (in Chrome) this is:
We could be retrieving this with:
If we just use textContent we would get something like:
Arguably if the file isn't valid XML we should just barf and refuse to open/process it but I think warning the end user would be better.
A more complete answer might be as described here but I think this might be excessive (?).
The text was updated successfully, but these errors were encountered: