How to: Lookup Document from Node

Is there a way to get the parent node or document from a Node?

Suppose a document has an attribute describing a base URL. All images in the document are rendered relative to the base URL. In order to generate the DOM for the image, I need to know the base URL of the document, but that doesn’t appear to be available in the node’s toDOM method. Would be nice if there was a parent property or something to be able to traverse back up from a given node.

Is there a better way to handle some document level properties which may impact rendering of children?

No. Since node objects are reused across documents, this is also definitely not going to happen. You’ll have to figure out some other way to represent this (probably the easiest way is to just make the URLs absolute).