开发者

Optimal Eclipse xml formatter settings for editing docbook xml documents

I'm using Eclipse to edit some DocBook documents in XML, and the auto-formatter does not a optimal job on handling end-of-tags not followed by spacing. As an example, if I write:

<para><emphasis>Hello</emphasis>, World!</para>

In the source document, after auto-format I get:

<para>
    <emphasis>Hello</emphasis>
    , World!
</para>

The problem here is that when building the output, that adds a space between "Hello" and the following comma, output something like "Hello 开发者_运维技巧, World!".

I did not see any parameter to handle that in the editor XML formatting configuration... Is there a way to handle this gracefully?


This problem deals with treating block tags (like para) versus inline tags (like emphasis) differently.

I would suggest that you install a dedicated editor for XML documentation, from the eclipse marketplace. I found a decent solution by installing a DITA toolkit for eclipse. DITA is a competitor to DocBook, but it is XML at its core, so many of the tools and workflows are equivalent.

Here are some options, including the DITA Open Platform editor, which I've used: http://marketplace.eclipse.org/search/apachesolr_search/dita

You can choose the DITA one or one of the others, like OxygenXML, which mention DocBook.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜