  We present an ab initio description of optical and shallow-core x-ray
absorption spectroscopies in a unified formalism based on the pseudopotential
plane-wave method at the level of the Bethe-Salpeter equation (BSE) within
Green's functions theory. We show that norm-conserving pseudopotentials are
reliable and accurate not only for valence, but also for semicore electron
excitations. In order to validate our approach, we compare BSE absorption
spectra obtained with two different codes: the pseudopotential-based code EXC
and the all-electron full-potential code Exciting. We take corundum
$\alpha$-Al$_2$O$_3$ as an example, being a prototypical material that presents
strong electron-hole interactions for both valence and core electron
excitations. We analyze in detail the optical absorption spectrum as well as
the Al L$_1$ and L$_{2,3}$ edges in terms of anisotropy, crystal local fields,
interference and excitonic effects. We perform a thorough inspection of the
origin and localization of the lowest-energy excitons, and conclude
highlighting the purely electronic character off the pre-edge of L$_1$ and the
dichroic nature of the optical and L$_{23}$ spectra.
