“When I use a word,’ said Humpty Dumpty, ‘it means just what I choose it to mean — neither more nor less.’
If you want to use the word "data format" to mean "a grammar that isn't defined using BNF and that isn't recursive" then you are welcome to do so. But I don't think you'll find it's a universally-accepted definition; and you'll find plenty of things that people call data formats that ARE recursive. In fact, a quick google gets among its top hits "the most common data formats found in modern APIs are JSON and XML".
It's not at all unusual for words to be used in a fuzzy way. By all means continue to do so if you wish. But please accept that unless you define your terms rigorously and precisely, your question "Is XML a language or a data format" doesn't have a binary answer.
Michael Kay Saxonica
Hi Folks,
I passed along the two Michael's comments to the colleague who asserted that data formats don't have grammars. Below is his response. Do you agree with his response? /Roger ----------------------------------------------------- So I offer....
"In theory there is no difference between theory and practice. In practice, there is." -Yogi Berra
First, to clarify, when I said a data format "doesn't have" a grammar, I did not mean that literally like in formal computer science (CS) terms.
I meant it figuratively. The term "grammar" in the CS sense, is just not relevant. It lives alongside "spelling" and "algebra" as things one had to learn once (high school?), but these terms aren't used nor needed with reference to practical work with data.
Rather, we data people use terms like structure, struct, record, and layout. And of course "format".
Are these just synonyms for "grammar"? I claim no. They denote things that are simpler. E.g., one big difference is no recursion. Are these terms just "simplified grammars" in the CS sense? Yes. But the words used are my point here.
Case in point: There is a military data spec document that is 5000 pages long and a large fraction of those pages describe the format of each of its messages. The term "grammar" does not appear anywhere in that 5000 page document. It is big, but it's 'just' a data format. ----------------------------------------------------- My colleague went on to say that if you remove XML's recursion capability, then it may be used as a data format; otherwise, it is a language.
|