Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
最后从 http://jeldoclet.sourceforge.net/ 找到了一个替代的 xml doclet
它非常轻量且功能强大: )
Finally found an alternative xml doclet from http://jeldoclet.sourceforge.net/
It is very lightweight and powerful :)
我不确定这是否是您所追求的,但是 SF 上有一个 名为 XHTML Doclet 的项目。它应该生成 XHTML javadoc 输出而不是传统的 HTML 输出。无论如何,我怀疑这与 Sun 的实现有任何关系。
您在问题中没有提到 XHTML,所以我不相信 XHTML 是您正在寻找的 XML。
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.
虽然这个问题看起来比较晦涩难懂,但我相信事实上它是非常重要的。 (但问题是这个问题本身问得有点不正确。)
所以,您正在(或正在)寻找 XML doclet...但是您在谈论什么 XML?
例如,XHTML 实际上是“XML”,生成 XHTML 的 doclet 与标准 doclet 大致相同(不确定标准 Doclet 是否已生成 XHTML)。
生成 DITA 输出的 doclet(DITA-doclet)同时也是一个“XML doclet”,因为 DITA 也是 XML!
对于生成此类格式的许多其他可能的 doclet 也可以这样说:
XSL-FO、SVG、Microsoft Office XML、Office Open XML 等。
事实上,可以为任何事物创建特定的 XML 词汇表。这就是为什么“XML”是可扩展标记语言!
所有这些“XML doclet”将彼此完全不同并且相当重量级,因为如果将 XHTML-doclet(又名标准 Doclet)视为一项工作,那么为什么还要其他 XML-doclet(例如 DITA-doclet)会更简单吗?
因此,您可能会猜到为什么现在没有很多纯“XML doclet”(那些最初的文档很久以前就被停止了)。我认为,这只是因为人们最终意识到几乎不可能为任何东西创建单个 doclet(或文档生成器)。就像你不能开发一个可以做任何事情(任何你想要的)的程序一样。
那么,为什么我不认为整个问题(关于 XML doclet)是毫无意义的呢?
因为本质上您正在寻找的并不是一个通用的“XML doclet”——那个东西不可能存在!相反,您需要一个工具来轻松开发适合您的特定 XML 词汇表的自定义 XML doclet。我相信,以这种形式,这个问题是非常合理的!
那个工具是什么?当然,通用编程语言(Java 本身)就是那个“工具”。但任务实际上并没有那么广泛。可以存在一种更集中的东西,它已经自动化了一般文档生成(特别是 Javadoc)中常见的许多操作。
这样的工具确实存在! (很久以前)
它被称为 DocFlex/Javadoc: http ://www.filigris.com/products/docflex_javadoc/
在 DocFlex/Javadoc 中,实际的 doclet 使用图形模板设计器以特殊模板的形式进行编程。此外,这些模板由封装为 Javadoc doclet 的模板解释器进行解释。模板本身与 XSLT 脚本有一些相似之处(尽管它们不是基于 XSLT)。
该模板系统有助于自动执行许多日常任务,并使您能够更加专注于数据处理本身和结果输出的设计。
尽管目前 DocFlex/Javadoc 更专注于 HTML 和 RTF 的生成,但也可以使用它生成任何 XML 标记。简单来说,DocFlex/Javadoc支持的第三种输出格式就是纯文本(TXT),而XML文件就是纯文本文件。
可以在模板中指定任何 XML 标记作为 TXT 输出的一部分发出。
因此,您将得到 XML 作为结果——任何 XML,只要您对其进行了编程即可。
基本上,它的工作方式与 XSLT 脚本相同,将一些 XML 文件转换为另一个 XML 输出。不同的是,这里的数据源不是XML文件而是Doclet API!
事实上,DocFlex/Javadoc 本身是一个更大项目的分支。另一个分支是 XML 模式文档生成器,它似乎在这里变得非常流行,例如,请参阅:如何将 xsd 转换为人类可读的文档?
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?