• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Quick question, re: spaces/tabs in XML files

Just a quick question to ask: what is the preferred indentation in XML files? A series of spaces, or a tab?

I ask as I've been looking at the learning material for Zend's guidelines for PHP and that says a series of four spaces is standard for PHP scripts (despite me using tabs for a number of years) and wondered if there was a equivalent standard for marking up XML files?


Senior Member
I always use tabs in coding whether it's XML or not. After all, one tab press is easier than four space bars ;)

At the end of the day it's semantics and won't make a real difference aside from readability.