开发者

Why don't empty tags in Ant build files have a space before the closing brace?

开发者 https://www.devze.com 2023-02-14 12:41 出处:网络
A pretty self-explanatory question really, just wondering why empty tags in Ant build.xml 开发者_开发问答files always seem to omit the space before the closing />, even though this is a requirement

A pretty self-explanatory question really, just wondering why empty tags in Ant build.xml 开发者_开发问答files always seem to omit the space before the closing />, even though this is a requirement for valid XML 1.0? Perhaps it's a convention that I wouldn't know about since I'm new to Ant, but I'm just curious.


A space before the closing /> isn't a requirement. The following are equivalent:

<foo/>

<foo />

Some XML editors will actually strip this space when formatting (oXygen in particular).

0

精彩评论

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

关注公众号