XML support is built into Ant, and not only as far as build
files go. You can validate XML documents using XML DTDs and schemas using
xmlvalidate task. You can read
properties from an XML document using
xmlproperty. You can use the
xslt/style task to transform XML documents using
XSLT. And you can use the
task to generate an XML DTD for all the tasks Ant knows about.
Besides covering these and other XML tasks, I’m going to discuss XDoclet in this chapter. XDoclet is an open source code generation engine that is designed to run in Ant. Using codes that you embed in Java source code, XDoclet can generate code, deployment descriptors such as web.xml, and other artifacts for Web and EJB applications.
I’ll also round out the discussion of EJB from the previous chapter by discussing the Ant EJB tasks, a specially designed set of optional tasks for developing Enterprise JavaBeans (EJBs).
You use the
task to validate XML documents with Document Type Definitions (DTDs) or
XML schema. Your build process may involve generating XML documents, and
it can be worthwhile to test those documents for validity before
deploying them (for example, see the section on XDoclet in this chapter.
You typically use XDoclet to generate XML documents for deploying web
applications, such as web.xml,
application.xml, and so on). By default, this task
uses the SAX2 parser implementation provided by Sun’s JAXP (http://java.sun.com/xml/jaxp/index.jsp ...