XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Is XML a language or a data format?

Every data format has a grammar. It might be expressed in narrative prose or in a diagram or through examples, rather than in BNF, but it has a grammar and without knowing the grammar, it's useless.

The JPEG spec says:

A JPEG image is represented as a sequence of segments where each segment begins with a marker. Each marker starts with 0xFF byte followed by marker flag to represent the type of marker. The payload followed by marker is different as per marker type. Common JPEG marker types are as listed below:

What's that, if not a grammar?

If there's a difference between the terms "data format" and "language", I think the distinction is to do with the expressive power. 

A traffic light can only send out a small finite set of messages ("Stop", "Go", "Get Ready") and we wouldn't normally call such a small set of utterances a language, because it doesn't have sufficient expressive power; but in any rigorous definition of what a language is, it's very likely to qualify. There is certainly a grammar:

SIGNAL := RED | GREEN | AMBER | RED+AMBER

Michael Kay
Saxonica

On 14 Jul 2022, at 10:53, Roger L Costello <costello@mitre.org> wrote:

Hi Folks,
 
Yesterday a colleague made a fascinating distinction between “language” and “data format”:
 
  • First he noted that English is a language, not a data format. Likewise, Java is a language, not a data format.
  • A language is specified by a grammar. There is a grammar for English and a grammar for Java. A language is intended to read by humans.
  • A data format probably does not have a grammar. It oftentimes is simply a collection of pieces and parts. It is intended to be processed by a machine. An example of a data format is JPEG (Exif). There is no grammar for it. It is just a series of parts pieced together as the graphic below illustrates.
Do you agree with that distinction? How do you define language? How do you define data format? How do they differ?
 
Is XML a language or a data format?
 
There is an XML grammar. XML is intended to be read by humans. Therefore, XML is a language. Right?
 
On the other hand, XML is a format for structuring data. XML is intended to be processed by machines. Therefore, XML is a data format. Right?
 
Which is it, a language or a data format?
 
/Roger
 
<image002.png>



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS