  In the paper, we derive the next-to-leading order (NLO) fragmentation
function for a heavy quark, either charm or bottom, into a heavy quarkonium
$J/\Psi$ or $\Upsilon$. The ultra-violet divergences in the real corrections
are removed through the operator renormalization, which is performed under the
modified minimal subtraction scheme. We then obtain the NLO fragmentation
function at an initial factorization scale, e.g. $\mu_{F}=3 m_c$ for $c\to
J/\Psi$ and $\mu_{F}=3m_b$ for $b\to \Upsilon$, which can be evolved to any
scale via the use of Dokshitzer-Gribov-Lipatov-Altarelli-Parisi equation. As an
initial application of those fragmentation functions, we study the $J/\Psi$
($\Upsilon$) production at a high luminosity $e^+e^-$ collider which runs at
the energy around the $Z$ pole and could be a suitable platform for testing the
fragmentation function.
