////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
////

Markup Views are written in Groovy, end with the file extension `gml` and reside in the `grails-app/views` directory.

The Markup Views plugin uses Groovy's {groovydocumentation}template-engines.html#_the_markuptemplateengine[MarkupTemplateEngine] and you can mostly use the {groovydocumentation}template-engines.html#_the_markuptemplateengine[Groovy user guide] as a reference for the syntax.

Example Markup View:

[source,groovy]
model {
    Iterable<Map> cars
}
xmlDeclaration()
cars {
    cars.each {
        car(make: it.make, model: it.model)
    }
}

This produces the following output given a model such as `[cars:[[make:"Audi", model:"A5"]]]`:

[source,xml]
<?xml version='1.0'?>
<cars><car make='Audi' model='A5'/></cars>

For further examples see Groovy's {groovydocumentation}template-engines.html#_the_markuptemplateengine[MarkupTemplateEngine] documentation.

All Markup views subclass the link:{api}grails/plugin/markup/view/MarkupViewTemplate.html[MarkupViewTemplate] class by default.

The `MarkupViewTemplate` superclass implements the link:{api}grails/plugin/markup/view/api/MarkupView.html[MarkupView] trait which in turn extends the link:{api}grails/views/api/GrailsView.html[GrailsView] trait.

