If your battery will not charge, you need to run a test on some components on the laptop. The battery, the charger and the laptop itself. Once you detect the faulty conponent then you replace it with a new one.
To test the battery:
1.Power off the laptop,
2.Take out the battery,
3.Insert it in another laptop,
4.Check of it will charge,
If the battery holds a charge there, then it means the problem is not from the battery, but if it does not hold a charge, then it means the battery is defective and need to be replaced with a new one.
To test the charger:
1.Unplug the charger from the present laptop,
2.Connect it to another laptop to see if it will charge.
If it charges the laptop, then it means the charger is alright, and if it does not charge the laptop, then it means the charger is bad and need to be replaced.
To test the laptop:
1.Turn off the laptop,
2.Disconnect your present charger,
3.Remove your present battery pack,
4.Insert a well tested battery into the laptop,
5.Connect a well tested charger to the laptop.
If it powers on, then it and charges, then it means the laptop is working fine, but if it does not charge, then it means the connection port of the laptop is bad.Hope this information was helpful.Dell XPS 15 AC Adapter Charger