Illegal Characters in reportXML.xml cause Viewer error

Post Reply
opakman84

Do you any scripts that can remove illegal characters either in the protege repository or from the reportXML.xml file? This would be a great help, as I constantly run into these issues and I have to manually remove these characters from the reportXMl file. Thanks.
jonathan.carter

Yes, we have recently written a script to run in the Script Console Tab that identifies and removes illegal XML characters from the repository in Protege.
I will post it to the share area and post back here once it is available

Jonathan
jonathan.carter

I've just uploaded a copy of the script I use to identify and remove invalid XML characters from the repository in Protege.

Resolve Invalid Characters is a Jython script to be run in the Protege Script Console tab.

It runs in 2 modes:
  • Find and remove all invalid characters
  • Identify and report all invalid characters - which gives you the opportunity to resolve any invalid characters manually.

    To use the script, just go to the Script Console tab in Protege and type:

    Code: Select all

    execfile("<FULL PATH TO YOUR COPY OF THE SCRIPT>/resolveInvalidXMLChars.py")
    Note, you need to use the Unix-style '/' directory separators as we're running in Java.

    Once this has run, the script will print some further instructions for how to use it.
    Example:

    Code: Select all

    execfile("C:/Downloads/resolveInvalidXMLChars.py")
    
    removeInvalidCharacters(False)
    
    Reports all instances with invalid characters in the reported slot.

    Hope this helps you out.


    Jonathan
Post Reply