1

我正在寻找可以生成 xml 格式而不是默认 html 的 javadoc 的 doclet。经过一番搜索,我发现有一个 Sun XML doclet,以前位于http://www.sun.com/xml/developers/doclet/

但是这个链接不再有效,有人有 Sun xml doclet 的副本吗?或任何其他替代xml doclet?

4

3 回答 3

1

终于从http://jeldoclet.sourceforge.net/找到了一个替代的 xml doclet

它非常轻巧且功能强大:)

于 2011-02-16T09:40:47.873 回答
0

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?

于 2012-05-01T08:34:06.263 回答
0

我不确定这是否是您所追求的,但SF 上有一个名为 XHTML Doclet 的项目。它应该产生 XHTML javadoc 输出而不是传统的 HTML 输出。无论如何,我怀疑这与 Sun 的实施有关。

你没有在你的问题中提到 XHTML,所以我不相信 XHTML 是你正在寻找的 XML。

于 2011-02-15T18:35:28.423 回答