不生成
<?xml version="1.0" encoding="UTF-8"?><event type="sync_data" time="6/20/08 11:34 AM" />而生成
<?xml version="1.0" encoding="UTF-8"?><event type="sync_data" time="6/20/08 11:34 AM">
</event>谢谢。
<?xml version="1.0" encoding="UTF-8"?><event type="sync_data" time="6/20/08 11:34 AM" />而生成
<?xml version="1.0" encoding="UTF-8"?><event type="sync_data" time="6/20/08 11:34 AM">
</event>谢谢。
<event type="sync_data" time="6/20/08 11:34 AM" /> 与<?xml version="1.0" encoding="UTF-8"?>
<event type="sync_data" time="6/20/08 11:34 AM">
</event> 功能是一样的。你比如说:
<div id="class"/> ...
与
<div id="class"> ...</div>功能也是一样的。
static Format getPrettyFormat()
Returns a new Format object that performs whitespace beautification with 2-space indents, uses the UTF-8 encoding, doesn't expand empty elements, includes the declaration and encoding, and uses the default entity escape strategy.
static Format getRawFormat()
Returns a new Format object that performs no whitespace changes, uses the UTF-8 encoding, doesn't expand empty elements, includes the declaration and encoding, and uses the default entity escape strategy.
Format setExpandEmptyElements(boolean expandEmptyElements)
This will set whether empty elements are expanded from <tagName/> to <tagName></tagName>.