You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

xmlvalidate.html 3.0 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <html>
  2. <head>
  3. <title>XMLValidate Task</title>
  4. </head>
  5. <body>
  6. <h2><a name="xmlvalidate">XMLValidate</a></h2>
  7. <h3>Description</h3>
  8. <p>
  9. This task checks xml files are valid (or only well formed). The task uses crimson SAX2 parser implementation by default, but one can specify any SAX1/2 parser if needed
  10. </p>
  11. <h3>Parameters</h3>
  12. <table border="1" cellpadding="2" cellspacing="0">
  13. <tr>
  14. <td valign="top"><b>Attribute</b></td>
  15. <td valign="top"><b>Description</b></td>
  16. <td align="center" valign="top"><b>Required</b></td>
  17. </tr>
  18. <tr>
  19. <td valign="top">file</td>
  20. <td valign="top">the file(s) you want to check. (optionally can use an embedded fileset)</td>
  21. <td valign="top" align="center">No</td>
  22. </tr>
  23. <tr>
  24. <td valign="top">lenient</td>
  25. <td valign="top">
  26. if true, only check the xml document is well formed
  27. (ignored if the specified parser is as SAX1 parser)
  28. </td>
  29. <td valign="top" align="center">No</td>
  30. </tr>
  31. <tr>
  32. <td valign="top">classname</td>
  33. <td valign="top">the parser to use. (default: crimson).</td>
  34. <td align="center" valign="top">No</td>
  35. </tr>
  36. <tr>
  37. <td valign="top">classpathref</td>
  38. <td valign="top">where to find the parser class. Optionally can use an embedded classpath element.</td>
  39. <td align="center" valign="top">No</td>
  40. </tr>
  41. <tr>
  42. <td valign="top">failonerror</td>
  43. <td valign="top">fails on a error if set to true (defaults to true).</td>
  44. <td align="center" valign="top">No</td>
  45. </tr>
  46. <tr>
  47. <td valign="top">warn</td>
  48. <td valign="top">log parser warn events.</td>
  49. <td align="center" valign="top">No</td>
  50. </tr>
  51. </table>
  52. <h3><a name="nested">Nested Elements</a></h3>
  53. <h4>dtd</h4>
  54. &lt;dtd&gt; is used to specify different locations for DTD resolution.
  55. <table border="1" cellpadding="2" cellspacing="0">
  56. <tr>
  57. <td width="12%" valign="top"><b>Attribute</b></td>
  58. <td width="78%" valign="top"><b>Description</b></td>
  59. <td width="10%" valign="top"><b>Required</b></td>
  60. </tr>
  61. <tr>
  62. <td valign="top">publicId</td>
  63. <td valign="top">Public ID of the DTD to resolve</td>
  64. <td align="center" valign="top">Yes</td>
  65. </tr>
  66. <tr>
  67. <td valign="top">location</td>
  68. <td valign="top">Location of the DTD to use, which can be a file,
  69. a resource, or a URL</td>
  70. <td align="center" valign="top">Yes</td>
  71. </tr>
  72. </table>
  73. <h3>Examples</h3>
  74. <blockquote><pre>
  75. &lt;xmlvalidate file="toto.xml"/&gt;
  76. &lt;xmlvalidate failonerror="no" lenient="yes" warn="yes"
  77. classname="org.apache.xerces.parsers.SAXParser" &gt;
  78. classpath="lib/xerces.jar"&gt;
  79. &lt;fileset dir="src" includes="style/*.xsl"/&gt;
  80. &lt;/xmlvalidate&gt;
  81. &lt;xmlvalidate file="struts-config.xml" warn="false"&gt;
  82. &lt;dtd publicId="-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
  83. location="struts-config_1_0.dtd"/&gt;
  84. &lt;/xmlvalidate&gt;
  85. </pre></blockquote>
  86. <hr>
  87. <p align="center">Copyright &copy; 2001-2002 Apache Software Foundation. All rights
  88. Reserved.</p>
  89. </body>
  90. </html>