in the last century, under the title of Les mille et un jours: Contes Persans, by Petis de la Croix.
To return to the Gesta version of the Gaelic story of "The Baker of Beauly", No. 103 of Swan's translations. Here a king buys of a merchant three maxims for a thousand florins: (1) "Whatever you do, do wisely and think of the consequences. (2) Never leave a highway for a by-way. (3) Do not be a guest in a house where the husband is old and the wife is young." By observing the first bit of advice the king saves his royal throat from being slit by a barber, who has been hired to do so by the prime minister. By observing the second and the third he also saves his life.
In my Popular Tales and Fictions, vol. ii, p. 317 ff., I have adduced an earlier monkish version of the incident of the royal barber, as well as Arabian and Turkish variants, and a Kashmirí analogue, finally tracing it to an old Buddhist collection, and on p. 491 giving a version from Ceylon. Swan, in the notes to his rendering of the Gesta, cites from Petis de la Croix, Contes Turcs (a fourth of the Turkish "Forty Vazirs" done into French) the Ottoman version, where, however, the king gets but one maxim for his money: "Consider well before you do any deed"; and I have no doubt that originally the story came to Europe in a form similar to that of the Gesta version, but with the incident relating to the first maxim as the last.
For a full discussion of this story cycle, see Mélusine, iii, 473-513; iv, 166 (the latter reference reproducing M. René Basset's elaborate variant list, Contes Berbères, pp. 226-28).