Menu

Validatation with external validators?

Help
2007-04-30
2012-12-07
  • Nobody/Anonymous

    How difficult would it be to allow XML Copy Editor to support external validation tools such as Jing?

    For example, if Jing is installed as a command-line tool on my system and produces its output in the standard one-line-per-error, pathame:lineno:error format, is there a way I can integrate it into XML Copy Editor for validation?

    Ideally, an external-validator feature would let me add external validators to XML Copy Editor by providing a validator name (e.g., "Jing RELAX NG validator") and a corresponding, parametrized command line that tells XML Copy Editor how to run the tool.  For example:

        jing {schemapath} {fullpath}

    where {schemapath} represents the full path to the desired schema and {fullpath} the full path to the document to be validated.  XML Copy Editor could then add the validator to the list of options in the XML->Validate... submenu:

        DTD
        XML Schema
        ---
        RELAX NG...
        Jing RELAX NG validator...  <--- our newly added validator
        (other menu items)

    When I select the new option from the Validte submenu, XML Copy Editor could prompt me for the schema to use (remembering my last selection, just like the RELAX NG... validation feature does), run the tool, and then place the results into the Warning pane.

    What's interesting is that the existing Tools->Command functionality *almost* supports this feature.  With it, I can configure XML Copy Editor to run Jing with the following command

        jing /path/to/schema.rng {fullpath}

    and place the output into a new document tab:

        /tmp/mydoc.xml:72: error: unknown element "b"
        /tmp/mydoc.xml:74: error: unknown element "b"
        /tmp/mydoc.xml:76: error: unknown element "b"
        /tmp/mydoc.xml:78: error: unknown element "b"

    If I could somehow convince XML Copy Editor (1) to place the output into the Warning pane instead of a new document tab and (2) to parse the lines as pathname:lineno:error error messages that would, when clicked, autofocus on the appropriate lines in the XML file, that would complete the feature.

    What do you think?

    Cheers,
    Tom <tom@moertel.com>

    Refs:
    http://www.thaiopensource.com/relaxng/jing.html

     
    • gnschmidt

      gnschmidt - 2007-04-30

      Is this not possible via Tools>Command? This is exactly the kind of application I had in mind when I added the Command panel.

      If the command panel doesn't work as intended please let me know.

      -Gerald

       
    • gnschmidt

      gnschmidt - 2007-04-30

      So sorry, just realised I didn't read to the end of your message. I will try to capture error output separately in the warning pane from 1.0.9.5. Automatically focusing on the appropriate lines is a long-standing bug and one I'm hoping to fix shortly now that the framework has provided an alternative to the HTML window. Will try to get to this asap.

      Best,
      Gerald

       
    • Nobody/Anonymous

      Gerald,

      Thanks for your quick reply and for your dedication to XML Copy Editor and its community of users.  I looked at a lot of editors before I selected XML Copy Editor, and your history of positive, productive communication with your user community is one of the things that placed XML Copy Editor ahead of its peers.

      Your work is much appreciated.  Thank you!

      Cheers,
      Tom

       

Log in to post a comment.