Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm trying to get my head around the theoretical side of XML and GML. The OGC web page for GML states that:

The Geography Markup Language (GML) is an XML grammar for expressing geographical features.

But what does it mean by a "grammar"? I can't see that phrase (as a noun) used anywhere else. Is it a unique GML meaning?

I see the terms "language", "schema", "format" and "standard". Are they the same thing?

So can I say that GML is an XML schema? Or would that mean something different? If so, is there a single XSD file that defines the entire GML specification?

share|improve this question
    
Thanks for the answers everyone. All very useful information. Things are slowly becoming clearer! –  Mark Ireland Apr 2 '12 at 17:09
add comment

3 Answers 3

up vote 5 down vote accepted

When someone designs a class of XML documents for representing information in a particular domain, they will sometimes call this an XML grammar, or a vocabulary, or a schema, or a document type, or even a language. The terminology isn't consistent. There's perhaps a different emphasis: calling it a schema implies that an XML Schema is the primary way in which the grammar/vocabulary is specified; but they all mean essentially the same thing.

share|improve this answer
add comment

From W3C's Extensible Markup Language (XML) 1.0 (Fifth Edition) recommendation:

[Definition: The XML document type declaration contains or points to markup declarations that provide a grammar for a class of documents. This grammar is known as a document type definition, or DTD. The document type declaration can point to an external subset (a special kind of external entity) containing markup declarations, or can contain the markup declarations directly in an internal subset, or can do both. The DTD for a document consists of both subsets taken together.]

As for GML, you are correct that it has evolved from using DTDs to XML Schema Definitions. You can download these files here: http://schemas.opengis.net/gml/

See also the GML Wikipedia article for an overview of the history of GML.

The W3C's XML Schema Primer is another good resource for learning about XSDs, but curiously no mention of the word 'grammar'.

share|improve this answer
add comment

Every XML document essentially has some given structure. When the structure is formally specified, we usually talk about a given XML grammar.

The formal specification can take many forms, e. g. DTD (Document Type Definition) or XML Schema Definition (XSD). XSD itself is a XML document and is now being used for GML. There are also other means of specifying XML structure, like RELAX NG. These can all be effectively used for validating that a XML document conforms to the schema (grammar) as specified.

Even if you unambiguously describe a XML document structure in pure English, it does have a grammar.

So, to answer your question, we could say that GML is a XML grammar for which a XML Schema Specification exists (link).

Another term used in place of XML grammar is also XML dialect.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.