Below is the line of succession to the Spanish Throne in 1705, this is based on male-primogeniture, this list is limited to all living descendants of King Philip II of Spain. The Austrian succession would be slightly different, but not by much as both lines were so heavily intermarried.
Louis, Dauphin of France 1661-1711 (grandson of Philip IV)
Louis, Duke of Burgundy 1682-1712 (great-grandson of Philip IV)
Philippe of France, Duke of Anjou 1683-1746 (great-grandson of Philip IV)
Charles, Duke of Berry 1686-1714 (great-grandson of Philip IV)
King Louis XIV of France 1638-1715 (grandson of Philip III)
Philippe II, Duke of Orleans 1674-1723
Louis d'Orleans 1703-1752
Marie Louise Élisabeth d'Orléans 1695-1719
Louise Adelaide d'Orleans 1698-1743
Charlotte Aglaé d'Orléans 1700-1761
Anne Marie d'Orléans 1669-1728 married to Victor Amadeus II of Savoy (great-granddaughter of Philip III)
Victor Amadeus Filippo Giuseppe, Prince of Piedmont (1699-1715)
Charles Emmanuel III of Savoy (1701-1773)
Princess Marie Adélaïde of Savoy 1685-1712 (Dauphine of france)
Princess Maria Luisa Gabriella of Savoy 1688-1714 (later consort of Philip V of Spain)
Élisabeth Charlotte d'Orléans 1676-1744 (Duchess of Lorraine)
Louis, Hereditary Prince of Lorraine 1704-1711
Élisabeth Charlotte of Lorraine 1700-1711
Marie Gabrièle Charlotte of Lorraine 1702-1711
Joséphine Gabrièle of Lorraine 1705-1708
Joseph I, Holy Roman Emperor (1678–1711)
Charles VI, Holy Roman Emperor (1685–1740)
Archduchess Maria Elisabeth (1680–1741)
Maria Anna of Austria, future Queen-Consort of Portugal (1683-1754)
Archduchess Maria Magdalena of Austria (1689–1743)
Victor Amadeus II of Savoy 1666-1732
Maximilian II Emanuel, Elector of Bavaria 1662-1726
Charles Albert of Bavaria (1697–1745)
Ferdinand Maria of Bavaria (1699-1738)
Clemens August of Bavaria (1700-1761)
Alois Johann Adolf of Bavaria (1702-1705)
Johann Theodor of Bavaria (1703-1763)
Maria Anna Karoline of Bavaria (1696-1750)
Joseph Clemens of Bavaria, Elector and Archbishop of Cologne (1673-1731)
Violante Beatrix of Bavaria, Grand Princess of Tuscany (1673-1731)
Ferdinand Charles, Duke of Mantua and Montferrat (1652-1708)
Leopold, Duke of Lorraine (1679-1729)
Charles Joseph of Lorraine (1680-1715)
Joseph Innocent Emanuel of Lorraine (1685-1705)
Francis Anthony of Lorraine (1689-1715), Abbot
Mary of Modena, Queen of England and Scots (1658-1718)
James of England and Scots Prince of Wales (1688-1766)
Louisa Maria Teresa of England (1692-1712)
Rinaldo d'Este, Duke of Modena and Reggio (1655-1737)
Francesco d'Este (1698-1780)
Gian Feerico d'Este (1700-1727)
Benedetta Maria Ernesta d'Este (1697-1777)
Amalia Giuseppina d'Este (1699-1778)
Enrichetta d'Este (1702-1777)
Elisabeth Farnese (1692-1766)
Margherita Maria Farnese, Duchess of Modena (1664-1718)
Eleonora d'Este (1643-1722)
Francesco Maria Farnese, Duke of Parma (1678-1727)
Antonio Farnese of Parma (1679-1731)
Isabella Farnese (1668-1718)
Maria Vittoria Gonzaga, Duchess of Guastalla (1659-1707)
Giuseppe Gonzaga (1690-1746)
Antonio Gonzaga (1687-1729)
Eleonora Gonzaga (1686-1742)
Emanuele Filiberto Amedeo) (1628–1709), 2nd prince de Carignan
Victor Amadeus I (1690-1741), Prince of Carignan
Maria Isabella of Savoy (1687-1767)
Maria Vittoria of Savoy (1688-1763)
Prince Thomas Emmanuel of Savoy, Cout of Soissons (1687-1729)
Prince Maurice of Savoy (1690–1710)
Prince Eugene of Savoy (1692–1712)
Princess Maria Anna Victoria of Savoy (1683–1763)
Prince Eugene of Savoy (1663–1736)
Princess Louise Philiberte of Savoy (1667–1726)
Ludwig-Wilhelm, Margrave of Baden-Baden (1655-1707)
Ludwig-Georg Simpert von Baden-Baden (1702-1761)
Wilhelm Georg Simpert von Baden-Baden (1703-1709)
August von Baden-Baden (1704-1726)
August Georg Simpert von Baden-Baden (1706-1771)