I'm reading "Introduction to toric varieties" by "William Fulton", here is an example in page 61 illustrating the difference between Weil divisors and Cartier divisors. Here my question is only about these divisors(not about toric variety), so I change the form such that it doesn't involve the toric variety. I know only basic definition of divisors so correct me if I write something wrong.
Example: In the cone $XZ-Y^2$, the line $X=Y=0$ is a Weil divisor $D$. Then $D$ is not a Cartier divisor but $2D$ is, and $2D$ is a principal divisor.
What is the function that give the principal divisor $2D$? Is it just $X^2$? Then why function $X$ does not give a principal divisor $D$?
I think I get it now. Is this correct?
The local ring $\mathbb{C}[X,Y,Z]_{(X,Y)}$ has a maximal ideal $(X,Y)$, it is generated by $Y$ because $X=Y(Y/Z)$, then $X$ has valuation $2$ at $D$. Function $Y$ has valuation $1$ at $D$ but $div(Y)=D+D'$ where $D'$ is the line $Y=Z=0$.