tailieunhanh - Ant The Definitive Guide phần 2

Strings (cùng với các thuộc tính khác) có thể giới hạn thuộc tính XML. Ví dụ, các yếu tố, quy định cụ thể các đối số dòng lệnh cho các cuộc gọi quá trình tương ứng của họ. Những 1tham khảo | Ant The Definitive Guide Simple Object Access Protocol SOAP . Outside of the Java world XML finds equally great acceptance giving Ant a wide potential user base. XML s parser and model libraries are freely available as Java libraries. Documentation is not a problem there are hundreds of books magazines and web sites dedicated to XML technology. As a general-purpose description language XML fits the complex use-case requirements set forth earlier. It can describe operations data types data values and project layout. These attributes of XML map closely to Ant s design requirements. XML is the best choice for Ant. Ant Building Blocks With XML elements and tags we can look at the primary components of an Ant buildfile as components or building blocks. We build the buildfile using these blocks. Some pieces have very specialized uses while others are more common and used more frequently. Let s look at the primary components of the Ant buildfile. The Project We call the set of tags and elements in an XML file from the root element in this case project to the lowest-nested tag the document object model or DOM . The first or root element of any buildfile is always the project tag. No buildfile can be without one nor can it have more than one. The DOM lays elements out in a tree-like hierarchy making the buildfile more of an object model than simply a plain process-description document. The following example shows a valid project tag project name MyProject default all basedir . . project The project tag has three attributes name default and basedir. The name attribute gives the project a name. A project name is valuable for purposes of identifying log output to know what project you re building . For systems that manage buildfiles such as an IDE that can read buildfiles the project name acts like an identifier for the buildfile. The default attribute refers to a target name within the buildfile. If you run Ant without specifying a target on the command line Ant .