I wrote previously that I had tried using the XML Spy 2008 Java API to generate Schema documentation, and it hadn't worked. I ended up with an exception in the DLL code that the Java API uses to control XML Spy, and I assumed it was a problem with the Java API, perhaps that it wasn't well enough tested. However, Liz Andrews from Altova kindly posted a comment with some sample code for using the Java API. Thanks, Liz! I can see now where I made my mistake; the Java API reflects the style of the XML Spy COM API, so it's slightly unusual for a Java API, and I hadn't understood the correct way to create a "SpySchemaDocumentationDlg" object. However, the sample code shows exactly how it is done. I haven't tested it yet, but it looks good to me, I can see why it would work and why my own code didn't work.
The documentation that comes with the XML Spy Java API is somewhat minimal, so I hope Altova will think of including this example with the documentation, or adding the example to their web site, at it's an example that explains a lot that the documentation doesn't cover.