Is Sun Xml doclet still available?

894 views Asked by At

I am looking for a doclet that can generate javadoc in xml format instead of the default html. After some search, I found there was a Sun XML doclet, previously located at http://www.sun.com/xml/developers/doclet/

However this link no longer works, does anyone have a copy of Sun xml doclet? or any other alternative xml doclet?

3

There are 3 answers

1
qichuan On BEST ANSWER

Finally found an alternative xml doclet from http://jeldoclet.sourceforge.net/

It is very lightweight and powerful :)

1
Grzegorz Oledzki On

I am not sure if this is what you are after, but there's a project on SF called XHTML Doclet. It's supposed to produce XHTML javadoc output instead of traditional HTML one. Anyway I doubt it has anything to do with Sun's implementation.

You didn't mention XHTML in your question, so I am not convinced XHTML is the XML you are looking for.

2
Leonid Rudy On

Although this question looks like an obscured one, I believe in fact it is pretty much important. (But the problem is the question itself was asked somewhat incorrectly.)

So, you are (or were) looking for an XML doclet... But what XML are you talking about?

For instance, XHTML is actually "XML" and an XHTML-generating doclet would be about the same as the standard one (not sure if the Standard Doclet already generates XHTML). A doclet generating DITA output (a DITA-doclet) would be also an "XML doclet" at the same time, because DITA is XML too!

The same could be said about lots of other possible doclets generating such formats like: XSL-FO, SVG, Microsoft Office XML, Office Open XML and so on.

In fact, a certain XML vocabulary can be created for about anything. That's why "XML" is eXtensible Markup Language!

All those "XML doclets" would be completely different from each other and quite heavyweight, because if to consider the XHTML-doclet (aka the Standard Doclet) as a piece of work, then why other XML-doclets (e.g. a DITA-doclet) would be simpler?

So, you may guess why there are no many pure "XML doclets" now (and those which initially were have been stopped long ago). I think, that's simply because people eventually realized that it is impossible to created a single doclet (or documentation generator, that is) for pretty much anything. The same as you cannot develop a program that does anything (any your wish).

So, why don't I think that the whole question (about the XML doclet) is senseless then?

Because what essentially you are looking for is not an universal "XML doclet" as it is -- that thing cannot exist! Rather, you need a tool for easy development of a custom XML doclet for your particular XML vocabulary. In that form, I believe, the question is very much legitimate!

What is that tool? A general programming language (Java itself) would be that "tool" of course. But the task actually isn't that wide. A more focused thing can exist that would already automate lots of operations common to the documentation generation in general (and to Javadoc in particular).

Such a tool does exist! (and quite long ago at that)

It is called DocFlex/Javadoc: http://www.filigris.com/products/docflex_javadoc/

In DocFlex/Javadoc, the actual doclets are programmed in the form of special templates using a graphic Template Designer. Farther, those templates are interpreted by the Template Interpreter wrapped as a Javadoc doclet. The templates themselves have some analogy to XSLT scripts (though they are not based on XSLT). That template system helps to automate lots of routine tasks and will allow you to concentrate more on the data processing itself and the design of the result output.

Although, currently DocFlex/Javadoc is more focused on the generation of HTML and RTF, any XML markup can be generated with it as well. Simply, the third output format supported by DocFlex/Javadoc is just plain text (TXT), and XML files are plain-text files. Any XML tags can be specified in the templates to be emitted as part of the TXT output. So, you will get XML as a result -- any XML at that, so much any as you have programmed it.

Basically, it works the same as an XSLT script, which converts some XML file(s) into another XML output. The difference is that the data source here is not XML files but the Doclet API!

In fact, DocFlex/Javadoc itself is an offshoot of a much bigger project. Another offshoot is an XML Schema documentation generator, which appears to become quite popular here, e.g. see: How to convert xsd to human readable documentation?