In my case Your code display url of a present page (not parents).
I've also tried:
DocumentContext.CurrentDocumentParent.AbsoluteURL #
This worked on the "web part properties" window, for example in "content before" field, but in Transformation that code generated errors (problem with DocumentContext). Do I have to change the "Transformation type" to "text/xml"?