Because the current British monarch is a woman I had assumed that the crown passes to the oldest child of the previous (just deceased) monarch. But the crown passes to the oldest male child of the previous monarch, even if he has older sisters. It only passes to the daughter if there are no sons.
Britain recently changed the law so that now it does pass to the oldest child, regardless of gender. Which is how it is in Denmark; I don't know how long it's been that way there, or what Sweden does.
France had laws called the Salic laws, one of which was that the crown or title (duke or whatever) could only pass to a male. So if the current heir had no sons then they went up the family tree and looked to see if he had any brothers still living, or nephews, going up and out on the tree as necessary. Up until fairly recently the laws were that when a man and a woman married everything that the woman owned became the man's property. (Also true in the US.) Even her title if she had one. (But not the title of king if she was the queen typically.) Before the French had the Salic law Elenore of Aquitaine had no brothers and so became the Duchess of Aquitaine. A person with a title was required to get permission from the king before they got married in order to avoid problems. Elenore of Aquitaine sneaked off and eloped with the King of England, whereupon he became the Duke of Aquitaine (and thereby vassal to the King of France). I'm guessing that this was probably a factor in the passing of the Salic law.http://en.wikipedia.org/wiki/Salic_law#Some_tenets_of_the_law