This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
As discussed in bug #43871, it would be nice for any build.xml to be recognized as an Ant script, even if empty (so that XML sniffing cannot yet work). Your obvious thought would be to extend ant-mime-resolver.xml to do this. But the DTD only allows matching on file extension, not full name. Bug #18910 discusses the arbitrariness of the declarative resolver syntax, though I think it does not specifically mention this limitation. Even if you define a MIMEResolver (registered with @ServiceProvider) which makes this check, it is never called; due to the fix of bug #141355, the declarative resolver for *.xml is called first and claims it. Used to be partially worked around by making AntProjectDataLoader treat all build.xml as an AntProjectDataObject, so it gets the right node (even though other features keyed off MIME type like the Navigator would not work), but I am dropping APDL in favor of DataLoaderPool.factory.
Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/9a4336f43c38 User: Jesse Glick <jglick@netbeans.org> Log: Using standard DataLoaderPool.factory rather than a programmatic DataLoader. (Minor functional regression #199927: cannot recognize empty build.xml.)
Sounds like an enhancement for additional DTD format. Feel free to donate patch.
Actually it seems this case is possible now.
core-main #e33b14dc3ef0
Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/e33b14dc3ef0 User: Jesse Glick <jglick@netbeans.org> Log: #199927: Impossible to recognize build.xml as text/x-ant+xml