The fragmentation functions $D(z)$ describe properties of partons and are therefore the same, no matter how the partons are produced. Consider the inclusive leptoproduction cross section $\sigma(\mathrm{ep} \rightarrow \mathrm{hX})$ and show that
$$
\frac{1}{\sigma} \frac{d \sigma}{d z}(\mathrm{ep} \rightarrow \mathrm{hX})=\frac{\sum_q e_q^2 f_q(x) D_q^h(z)}{\sum_q e_q^2 f_q(x)},
$$
where $f_q(x)$ are the proton structure functions of Chapter 9, see Fig. 11.6. The sum runs over the quarks and antiquarks that can be a parent of $h$.