Skip to main content
Share Your Experience: Take the 2024 Developer Survey
245 votes
Accepted

Why is XML called a "language" exactly?

The real answer is XML has an L in the name because a guy named Raymond Lorie was among the designers of the first "markup language" at IBM in the 1970'ies. The developers had to find a name for the ...
JacquesB's user avatar
  • 59.7k
179 votes

Why is XML called a "language" exactly?

Because it is a language. A markup language, not a programming language. Notice that natural human languages like English and Spanish don't "do" anything either. In fact, technically C++ and Java and ...
Ixrec's user avatar
  • 27.6k
103 votes

Why is XML called a "language" exactly?

Let Σ be a non-empty, finite set of symbols, called an alphabet. Then Σ* is the countable infinite set of finite words that can be formed by concatenating zero or more symbols from Σ....
5gon12eder's user avatar
  • 7,196
31 votes

Why is XML called a "language" exactly?

In computer science, formal language is just a set of strings, usually infinite and often described using rules (two common versions of those rules are regular expressions and formal grammars). Note ...
svick's user avatar
  • 10.1k
16 votes
Accepted

What are advantages of XML over S-expressions(-ish) notation?

We know the designers of XML were familiar with S-expressions, since XML is based on SGML, and SGML has a style sheet language, DSSSL, which uses S-expression syntax (and scheme as embedded scripting ...
JacquesB's user avatar
  • 59.7k
12 votes

Why is XML called a "language" exactly?

A language is a method of conveying information. A programming language is a method of conveying algorithms. A markup language like XML is a language for conveying data.
Philipp's user avatar
  • 23.3k
11 votes

How to parse XML files too big to fit in memory

Streaming API (such as SAX see https://docs.oracle.com/javase/tutorial/jaxp/sax/) vs DOM api's. Former one process tags as they occur, while the latter represents the entire DOM model in memory. See ...
YoYo's user avatar
  • 586
10 votes

What are advantages of XML over S-expressions(-ish) notation?

Personally, I think the best part about XML is the well-defined schema capabilities, rather than its syntax. The schema mechanism allows users to publish their document format to share what they ...
Erik Eidt's user avatar
  • 34.1k
7 votes
Accepted

How do different file types generally store data?

The reason there are many different file formats is that there are many different goals for the way data is formatted. Some of these are in opposition to each other and some are orthogonal to each ...
JimmyJames's user avatar
  • 27.5k
6 votes

In what way is an XML database different from (is not specialization of) a graph database?

The terms XML database and graph database describe the use cases of each kind of database. The XML database is intended to store and search XML documents. Graph databases is intended to represent a ...
Samuel's user avatar
  • 9,197
6 votes

Why not program our video text terminals/terminal emulators to use something JSON or XML on the backend instead of ANSI escape sequences?

Your question is sort of like saying assembly is difficult to work with, so computers should use higher level languages instead. The ANSI format is the right level of abstraction for working with ...
Karl Bielefeldt's user avatar
5 votes

Would you use Byte Arrays or XML if size was not an issue?

It is certainly possible that the JPEG and PNG people might have used XML-based headers if file size were not an issue. Using text would make it more obvious what all the fields mean and so forth. ...
Nicol Bolas's user avatar
  • 11.9k
5 votes

How to handle custom metadata in XML?

Besides the fact it is a very bad idea to parse XML by regular expressions, I try to answer your questions: Was XML designed to handle custom metadata? XML is designed to handle all kind of data ...
Doc Brown's user avatar
  • 209k
5 votes
Accepted

When to use 'nillable' in XML schemas

nillable is in the spec because the XML Schema WG had a number of members who saw the world in SQL terms and wanted an explicit equivalent to SQL's null values. It's totally unnecessary in my view: ...
Michael Kay's user avatar
  • 3,529
5 votes
Accepted

How to maintain XML/JSON serialization tests?

Tests of the kind you describe are brittle. As you've correctly pointed out, small changes are likely to break a significant number of the existing tests. But that is by design; tests like these are ...
Robert Harvey's user avatar
4 votes
Accepted

What terms are used to differentiate the two xml forms, "<element></element>" and "<element/>"?

In Extensible Markup Language (XML) 1.1 (Second Edition) Section 3.1 Start-Tags, End-Tags, and Empty-Element Tags, it's called an "empty-element tag". If you were using XML and needed the formal term, ...
Thomas Owens's user avatar
  • 82.8k
4 votes
Accepted

How to solve the problem with various data formats(XML,JSON,SOAP) for data exchange?

You use a very valid approach, but your question is quite broad: there are plenty of ways to handle it. The right answer will depend heavily on your existing architecture. My first guess would be to: ...
Christophe's user avatar
  • 77.9k
4 votes
Accepted

Tips and tricks in implementing XML or XML schema

Honestly, my answer would initially be: don't use XML. I've been working with XML for many years and the reality is that it's a terrible format for data exchange. JSON has it's own flaws but it is ...
JimmyJames's user avatar
  • 27.5k
4 votes
Accepted

Storing survey data from csv to xml

Which is the better encoding really depends on what you're trying to store. If you're storing the data gathered by the survey, it'll be much different than if you're storing a record of the user input ...
Morgen's user avatar
  • 1,091
4 votes

What is the best way to represent data with inheritance?

I suggest not using inheritance, but composition, eg:in json: Here is a "Person" { "name":"name", "age":32 } Here is a "Student", which holds a "Person" instead of becoming a "Person": { "...
ocomfd's user avatar
  • 5,712
4 votes
Accepted

Why not program our video text terminals/terminal emulators to use something JSON or XML on the backend instead of ANSI escape sequences?

There is a simple reason. When you are typing you can only input a character at a time. Something that is processing typed text has to deal with what in effect is invalid markup, half a json blob or ...
Ewan's user avatar
  • 76.4k
4 votes

Clean Architecture and Persistence Annotations

You basically answer your own question. Strictly following the "clean architecture" dogma leads to "many new classes and boilerplate code (...) this option may do more harm than good." If ...
JacquesB's user avatar
  • 59.7k
4 votes

Get a hash from XML

In both your C# and Java code, you are simply hashing the byte sequence contained in the string variable result. This will only yield the same hash value if both strings are byte for byte identical. ...
Stephen C. Steel's user avatar
4 votes
Accepted

Get a hash from XML

Your problem is that in the C# code, prior to canonicalization, you parsed the XML document with a parser that strips whitespace, whereas in Java, you preserved the whitespace. In general whitespace ...
Michael Kay's user avatar
  • 3,529
3 votes

Why store app configuration in a data file instead of code esp. when using Continuous Integration?

I have currently my config files in the build process, however whenever i will have the opportunity i will externalize them. Here is a general answer : Because the client may need to change some ...
Walfrat's user avatar
  • 3,496
3 votes

Xml Messages: One Type to Rule Them All?

I would foster the first approach for 2 reasons: As far as I understand, painting a vehicle, changing its brakes or replacing oil are 3 distincts operations that are made separately (in time, in ...
Spotted's user avatar
  • 1,690
3 votes

Why XML is meant to be Software and Hardware independent?

Historically, the "normal" way to save structured data was to simply write the in-memory data to disk. However this caused several issues. It closely coupled the storage format to the ...
Peter Green's user avatar
  • 2,251
3 votes
Accepted

How to handle xml element with both CDATA and regular data using SimpleXML

I figured this out eventually. Hopefully this will help others in the future. What was needed was a way to interrupt the deserialization process and run some custom code to extract the data. ...
mez.pahlan's user avatar
3 votes
Accepted

Shorthand notation for XSLT?

I have come across many attempts to create a "user-friendly" or "compact" non-XML syntax for XSLT over the years, and as far as I know, none of them was ever used by anyone except its inventor. Most ...
Michael Kay's user avatar
  • 3,529

Only top scored, non community-wiki answers of a minimum length are eligible