So, you fought some Vampire Spawn, which have the annoying:
Energy Drain (Su): A creature hit by a vampire spawn's slam (or other natural weapon) gains one negative level. This ability only triggers once per round, regardless of the number of attacks a vampire spawn makes.
Those negative levels provided by the vampire spawn are temporary until after the duration specified and saving throw mechanics. After 24 hours, and after a failed save, they would then become permanent.
Negative levels remain until 24 hours have passed or until they are removed with a spell such as restoration. If a negative level is not removed before 24 hours have passed, the affected creature must attempt a Fortitude save (DC 10 + 1/2 the draining creature’s racial HD + the draining creature’s Cha modifier; the exact DC is given in the creature’s descriptive text). On a success, the negative level goes away with no harm to the creature. On a failure, the negative level becomes permanent. A separate saving throw is required for each negative level.
What does this mean? The character is dead. The temporary negative level remains. The negative level would have to be removed, otherwise he'd just die again.
Raising the character from the dead would have to have a restoration spell handy to remove the temporary negative levels, the same as if it were permanent negative levels.
The temporary negative levels have a 24 hour duration. That duration doesn't wipe itself off the table by character death. If that were the case, then undead with a create spawn ability would never be able to create spawn - as their energy drain attacks would simply go away when the character died.
The only rule supporting spell effects that end upon death, without special text stating otherwise, is a spell effect that require concentration. Obviously, a spell caster can't concentrate when he's dead.
What can you do?
- If the GM considers a dead1 creature, as still a creature, cast Restoration on the dead creature. There's a little bit of precedence to back that up. Raise Dead, for example, says, Target: Dead Creature. Of course, Restoration obviously doesn't have the word dead in front of Target: Creature Touched, but, ask the GM to work with you a little. The worst he can do is say no.
- If you don't have a Restoration spell handy, raise the dead character back to life, and the proceeding round cast Death Ward. That would make the character immune to the negative effects of the negative levels for the duration of the spell. That could afford you more time, especially with multiple castings of Death Ward.
- Raise him from the dead at exactly 24 hours from his death. That would give the party time to rest, have that much more preparation time (i.e. hireling services from a cleric, purchases of scrolls, pray for spells, etc.) and allow the newly raised character, with the negative levels, a quick chance at a fortitude save.
- Wait for the negative levels to expire and become permanent, and proceed to raise and restore as the rules are explicitly clearer on - probably with the assistance of higher level spell caster NPC's in a temple at the next town.
- Make a new character.
1Being dead doesn't say you become an object. It just says you are a dead character. It also doesn't say effects end when you're dead. It does say, if you are raised, you're raised in the same condition as when you died. If you have temporary negative levels when you died, and are then quickly raised, you'd still have the temporary negative levels.
The answers are in your quotes. Only the last sentence about attunement refers to the voluntary process:
A creature can also voluntarily end attunement by spending another Short Rest focused on the item, unless the item is cursed.
This is reinforced by the sentence under cursed items:
Attunement to a cursed item can't be ended voluntarily unless the curse is broken 1st such as with the Remove Curse spell.
Neither of those affect the forms of ending attunement involuntarily:
A creature's attunement to an item ends if the creature no longer satisfies the Prerequisites for attunement, if the item has been more than 100 feet away for at least 24 hours, if the creature dies, or if another creature attunes to the item.
So in this case, Player B can indeed attune to the item if he can get his hands on it, and this does (involuntarily) end the attunement to the item of Player A.
Best Answer
If that character is resurrected, for example with the Revivify or Raise Dead spells, will their attunement be restored along with their life?
No. If a character dies they lose the attunement as stated in the rules you quote. They will then have to re-attune to every item they were previously attuned to, which may not be possible if someone else has already done so in the intervening time or some other prerequisite has changed.
An exception would be a Wish spell used to re-create a Resurrection effect but with an additional "and re-attuned to all their items" clause, basically by changing all the pre-requisites to what they need to be and de-attuning anyone who attuned to the items in the meantime. However be careful with the wording as a clever DM will take you literally and there may be some un-desired consequences. Also this would be an effect that had the more dramatic consequences to the caster of making a Wish as it is beyond merely duplicating a spell.