You have your own definition of Nationalism, no wonder you're appearing to be uneducated.
Nationalism = Love on a nation scale
If it was then you wouldn't hate all immigrants living in Sweden. Nationalism to you is the right to persecute all non-nationals of a country.
Nationalism didn't cause WWI. It was imperialism. Wilhelm II wanted to be like UK. He wanted to have a big and powerful empire just like the rest of the great european powers. So he built a new navy and took several colonies which created a conflict between the UK and Germany. The French were already at Germany's throat because of Alsace-Lorraine.
All of these things are defined as imperialism.
Wilhelm II wanted to be better than the UK since he thought Germans were superior and deserved better via having an empire with resources and slaves (Nationalism+Imperialism). His Weltpolitik failed horribly though.
The French were at Germany's throat because they though A-L was a French province and the Germans thought it was theirs since it was pretty much half and half German and French speakers (Nationalism + Imperialism).
Everyone except you can accept that both are linked.