C.97 XmlLintTask

The XmlLintTask checks syntax (lint) one or more XML files against an XML Schema Definition.

Note: This assumes that the DOM extension is loaded in PHP5 since this is used to drive the validation process.

Table C.127: Attributes

NameTypeDescriptionDefaultRequired
schemaStringPath to XSD filen/aYes
fileStringPath to XML filen/aNo
haltonfailureBooleanStops the build when validation failstrueNo
useRNGBooleanSet to Yes if the Schema is in the n Relax NG formatfalseNo

C.97.1 Examples

<xmllint schema="schema.xsd" file="config.xml"/>

Validate one XML file against one XSD file.

<xmllint schema="schema.xsd">
  <fileset dir=".">
    <include name="**/config.xml"/>
  </fileset>
</xmllint>

Validate more XML files against one XSD file.

<fileset dir="./sources" id="sources">
  <include name="main.xml"/>
  <include name="chapter*.xml"/>
  <include name="appendix*.xml"/>
</fileset>
<property name="docbook.relaxng"
    value="/usr/share/xml/docbook/schema/rng/5.0/docbookxi.rng"/>

<xmllint schema="${docbook.relaxng}" useRNG="yes">
  <fileset refid="sources" />
</xmllint>

Validate a set of DocBook files against the DocBook RNG grammar

C.97.2 Supported Nested Tags