The charging system is simple:
Alternator ----> regulator ----> battery.
The alternator produces AC current like in your house. In some cars, this is rectified at the alternator's output and in others it's rectified in the regulator. Rectifying the AC converts the power into DC (which is what your battery needs).
The regulator limits the amount of voltage going to your battery to somewhere between 14.1 and 14.7V depending on manufacturer. D40s (and I presume most other Navara/Pathfinder/Terrano etc) usually use the 14.4-14.7V range.
The battery stores the power. This is one component I don't suspect to be the cause, although loose/dirty terminals can cause trouble.
What can go wrong? Alternator output might be zero AC so nothing will charge. It's usually worn brushes. The rectifier could be shot too - these are generally made up of 4 heavy duty diodes and some big capacitors. AC goes in, DC comes out. A diode or cap can blow - circuit is dead. The regulator will get a large input voltage (sometimes AC, so if you're testing the input side, check for both before calling the alternator a dud based on a DC voltage check of the regulator's input).
The only other thing that could be at fault is the alternator's shaft. Is it stuck, and the fan belt is just slipping over the pulley? Is the pulley just spinning on the alternator shaft?
There's a couple of things to check. Good luck!