C.86 XmlLintTask
Prev | Appendix C. Optional tasks | Next

## C.86 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.116: Attributes

Name | Type | Description | Default | Required
--- | --- | --- | --- | ---
`schema` | `String` | Path to XSD file | n/a | Yes
`file` | `String` | Path to XML file | n/a | No
`haltonfailure` | `Boolean` | Stops the build when validation fails | `true` | No
`useRNG` | `Boolean` | Set to Yes if the Schema is in the n Relax NG format | `false` | No

### C.86.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.86.2 Supported Nested Tags

- `fileset`

Prev | Up | Next
C.85 WikiPublishTask | Home | C.87 XmlPropertyTask