From what I was able to get from talking to people from Barcelona, anti-independence citizens were viewing the referendum as illegal and didn't attend. So it's no wonder that the separatists "won" the referendum, but it's legitimacy is rather questionable.