Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is XML a programming language?

Tags:

xml

I often hear when people list the programming languages they know, they mention XML.

But is it even a programming language?

I consider XML as a "dataset" similar to JSON.

Moreover, I have seen companies requiring knowledge of XML but... what is much to know there?

like image 412
Arturs Vancans Avatar asked Dec 02 '12 01:12

Arturs Vancans


People also ask

Why XML is not a programming language?

XML does not qualify to be a programming language as it does not perform any computation or algorithms. It is usually stored in a simple text file and is processed by special software that is capable of interpreting XML. The XML above is quite self-descriptive: It has sender information.

What type of code is XML?

The Extensible Markup Language (XML) is a simple text-based format for representing structured information: documents, data, configuration, books, transactions, invoices, and much more. It was derived from an older standard format called SGML (ISO 8879), in order to be more suitable for Web use.


3 Answers

A programming language?

First, XML is a format to represent data. It has originally be designed for this data to be essentially text documents or messages, but nothing prevents you from representing any data you wish, including programs. There at least three big examples of programs expressed in XML that come to mind:

  1. XSLT is a Turing-complete language whose only standard format is in XML, whose essential purpose is data transformations.
  2. ANT is a task manager, used mostly for compilation management, whose tasks are described in XML.
  3. GCC-XML is a format that GCC can use to output the result of its parsing of a source code.

On a more esoteric note, you could cite o:XML, a full-fledged XML programming language.

So as any XML, DTD or Schema semantically extends XML itself, you could technically argue that XML itself, through some of its extensions, is a programming language.

Is there much to know?

Second, XML is a vast nebula of specifications, and most people only barely scratch the surface. Most people don't even imagine the corner cases in XML itself, let alone what's in XML Namespaces, XML Schema, XML Information Set, XQuery, XPath, XSLT, XSL-FO, XML Canonicalization, XML Signature, Efficient XML Interchange, XML Linking, etc.

So, yeah, I'd say there's plenty to know...

like image 92
Nowhere man Avatar answered Sep 23 '22 16:09

Nowhere man


XML is not a programming language.

There are programming languages that use XML syntax, notably XSL.

There is a lot to learn about XML, however. The rules of its syntax, how namespaces and DTDs and schemas work, etc. Also, programmers using XML need to how to interact with documents via the DOM and XPath even if the language they're using is not itself XML-based.

like image 33
Mark Reed Avatar answered Sep 19 '22 16:09

Mark Reed


XML isn't a programming language anymore than HTML is, however tons of people will also list HTML as a programming language, so it isn't surprising.

what is much to know there?

XML has unique quirks about it, even though the libraries are quite powerful, knowing how to work with the libraries and knowing how to handle odd things the library cannot is very important.

For instance, the following would give you an "unexpected token at 0 : '&'" error, even though anyone with any XML experience would know what the problem really is. If you didn't know anything about XML it would look like garbage.

<Root>
    <Leaf />
</Root>
like image 42
Guvante Avatar answered Sep 19 '22 16:09

Guvante