at the end of execute. Add typedef to the child elements of project. Fix some docs. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272334 13f79535-47bb-0310-9956-ffa450edef68master
@@ -67,7 +67,9 @@ project.</p> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td valign="top">output</td> | <td valign="top">output</td> | ||||
<td valign="top">Filename to write the ant output to. | |||||
<td valign="top">Filename to write the ant output to. This is | |||||
relative to the value of the dir attribute if it has been set or | |||||
to the base directory of the current project otherwise. | |||||
</td> | </td> | ||||
<td align="center" valign="top">No</td> | <td align="center" valign="top">No</td> | ||||
</tr> | </tr> | ||||
@@ -13,9 +13,10 @@ | |||||
about all tasks currently known to Ant.</p> | about all tasks currently known to Ant.</p> | ||||
<p>Note that the DTD generated by this task is incomplete, you can | <p>Note that the DTD generated by this task is incomplete, you can | ||||
always add XML entities using <a | always add XML entities using <a | ||||
href="taskdef.html"><code><taskdef></code></a>. See <a | |||||
href="http://www.sdv.fr/pages/casa/html/ant-dtd.en.html" target="_top">here</a> for | |||||
a way to get around this problem.</p> | |||||
href="taskdef.html"><code><taskdef></code></a> or <a | |||||
href="typedef.html"><code><typedef></code></a>. See <a | |||||
href="http://www.sdv.fr/pages/casa/html/ant-dtd.en.html" | |||||
target="_top">here</a> for a way to get around this problem.</p> | |||||
<p>This task doesn't know about required attributes, all will be | <p>This task doesn't know about required attributes, all will be | ||||
listed as <code>#IMPLIED</code>.</p> | listed as <code>#IMPLIED</code>.</p> | ||||
<h3>Parameters</h3> | <h3>Parameters</h3> | ||||
@@ -35,7 +36,7 @@ listed as <code>#IMPLIED</code>.</p> | |||||
<blockquote><pre> | <blockquote><pre> | ||||
<antstructure output="project.dtd"/> | <antstructure output="project.dtd"/> | ||||
</pre></blockquote> | </pre></blockquote> | ||||
<hr><p align="center">Copyright © 2001 Apache Software Foundation. All rights | |||||
<hr><p align="center">Copyright © 2001-2002 Apache Software Foundation. All rights | |||||
Reserved.</p> | Reserved.</p> | ||||
</body> | </body> | ||||
@@ -149,9 +149,16 @@ public class AntStructure extends Task { | |||||
if (out != null) { | if (out != null) { | ||||
out.close(); | out.close(); | ||||
} | } | ||||
visited.clear(); | |||||
} | } | ||||
} | } | ||||
/** | |||||
* Prints the header of the generated output. | |||||
* | |||||
* <p>Basically this prints the XML declaration, defines some | |||||
* entities and the project element.</p> | |||||
*/ | |||||
private void printHead(PrintWriter out, Enumeration tasks, | private void printHead(PrintWriter out, Enumeration tasks, | ||||
Enumeration types) { | Enumeration types) { | ||||
out.println("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"); | out.println("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"); | ||||
@@ -183,7 +190,8 @@ public class AntStructure extends Task { | |||||
out.println(""); | out.println(""); | ||||
out.print("<!ELEMENT project (target | property | taskdef | "); | |||||
out.print("<!ELEMENT project (target | property | taskdef"); | |||||
out.print(" | typedef | "); | |||||
out.print(TYPES); | out.print(TYPES); | ||||
out.println(")*>"); | out.println(")*>"); | ||||
out.println("<!ATTLIST project"); | out.println("<!ATTLIST project"); | ||||
@@ -193,6 +201,9 @@ public class AntStructure extends Task { | |||||
out.println(""); | out.println(""); | ||||
} | } | ||||
/** | |||||
* Prints the definition for the target element. | |||||
*/ | |||||
private void printTargetDecl(PrintWriter out) { | private void printTargetDecl(PrintWriter out) { | ||||
out.print("<!ELEMENT target ("); | out.print("<!ELEMENT target ("); | ||||
out.print(TASKS); | out.print(TASKS); | ||||
@@ -211,6 +222,9 @@ public class AntStructure extends Task { | |||||
out.println(""); | out.println(""); | ||||
} | } | ||||
/** | |||||
* Print the definition for a given element. | |||||
*/ | |||||
private void printElementDecl(PrintWriter out, String name, Class element) | private void printElementDecl(PrintWriter out, String name, Class element) | ||||
throws BuildException { | throws BuildException { | ||||