Relation of Function Field of a scheme to the Local Ring of its Prime Divisor Refer to p. 130 in Hartshorne: Let $X$ be a noetherian, integral separated scheme, regular in codimension 1, and let $Y$ be a prime divisor of $X$, with generic point $\eta$. Let $\xi$ be the generic point of $X$ and $K=\mathcal{O}_{X,\xi}$ is the function field of $X$. I can see that $\mathcal{O}_{X,\eta}$ is an integral domain and that it can be injected into $K$. But why is $K$ the quotient field of $\mathcal{O}_{X,\eta}$?
 A: Pick an affine open $U=\mathrm{Spec}(A)$ containing $\eta$. Then $\mathscr{O}_{X,\eta}$ is the localization of $A$ at the prime ideal $\mathfrak{p}\in\mathrm{Spec}(A)$ corresponding to $\eta$. Also, since the generic point $\xi$ is in $U$, and necessarily corresponds to the generic point of $\mathrm{Spec}(A)$, i.e., the zero ideal, the local ring at the generic point is $A$ localized at the zero ideal, i.e., the field of fractions of $A$. Now you just have to prove that any localization of $A$ has the same field of fractions as $A$. Or more precisely, the canonical map $S^{-1}A\rightarrow\mathrm{Frac}(A)$ identifies the target as the field of fractions of the source for any multiplicative set $S\subseteq A$. 
In general, since local rings can always be computed in affine opens containing the relevant point, for an integral scheme, the function field can be computed on any affine open. So my answer above does not use regularity in codimension one or the Noetherian hypothesis, or separatedness. It only uses integrality. 
