  The purpose of this article is to define a capacity on certain topological
measure spaces $X$ with respect to certain function spaces $V$ consisting of
measurable functions. In this general theory we will not fix the space $V$ but
we emphasize that $V$ can be the classical Sobolev space $W^{1,p}(\Omega)$, the
classical Orlicz-Sobolev space $W^{1,\Phi}(\Omega)$, the Haj{\l}asz-Sobolev
space $M^{1,p}(\Omega)$, the Musielak-Orlicz-Sobolev space (or generalized
Orlicz-Sobolev space) and many other spaces. Of particular interest is the
space $V:=\tW^{1,p}(\Omega)$ given as the closure of $W^{1,p}(\Omega)\cap
C_c(\overline\Omega)$ in $W^{1,p}(\Omega)$. In this case every function $u\in
V$ (a priori defined only on $\Omega$) has a trace on the boundary
$\partial\Omega$ which is unique up to a $\Cap_{p,\Omega}$-polar set.
