Philippe Nobili wrote: > > We started to write XML schemas using XMLMind, a couple of weeks ago. We > have two questions related to xmltool and a small problem to report. > > *The questions:* > > 1. It seems that the output of xmltool is strictly identical to what you > get in XMLMind interactive application when you validate the document (I > suppose that internally you use the same code...).
That's right. See below. > > In XMLMind GUI, errors appear in three different colors based on > their severity; but in the list of errors itself, what you get is the > type of error. How do you establish the relationships between types of > error and the level of severity ? (which is a very important > information to capture in batch since it points you to the critical > problem). > > [NB: The context is that we daily have to check a couple of hundreds > instances of the same XML-schema automatically, so we'd better find the > real problems...] There is an API for that. See http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xml/validate/Diagnostic.html See http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xml/validate/Diagnostic.Severity.html "xmltool validate" could be modified to return a different exit code, depending on the maximum severity of the errors it reports. For now it uses the same non-null exit code, 12, whatever is this value. > > 2. When invoking xmltool by hand, it is not able to locate automatically > the XML schema, although we have an XMLMind addon, with a catalog > setting. This works fine from XMLMind GUI, but not from xmltool. The > workaround of course is to provide the XML schema using '-'s option, but > did we miss something else ? > No. Unlike convertdoc, which is XMLmind XML Editor in disguise, xmltool is just a low-level command-line utility built using the classes found in the com.xmlmind.xml.* packages. However xmltool is XML-catalog enabled. * It automatically uses XXE_install_dir/addon/config/catalog.xml * Moreover, you can define an environment variable called XML_CATALOG_FILES containing one or more absolute XML catalog URLs separated by semi-colons (';'). This is not documented but it's easy to guess how it works by reading the source of XXE_install_dir/bin/xmltool.bat > *The small problem:* > > When you author XML schemas using XMLMind, deleting node will make you > jump to a totally different position within the edited file, which makes > editing sometimes a little bit tedious... > This behavior is annoying but it's not a bug we can fix. XMLmind XML Editor automatically scrolls to let you see where is the caret (the real, red, caret contained in text, comment or PI node, not the local, black, caret of a text field) and an XML schema typically contains very few textual nodes. It's difficult to improve the situation. Let's say that XMLmind XML Editor is not the editor of choice when it comes to create, edit and even validate, XML schemas. (The only nice feature is that XMLmind XML Editor allows you to document the XML schema in WYSIWYG XHTML, provided that you have installed the add-on called "W3C XML Schema configuration".)

