diff --git a/samples/DOMPrint/DOMPrint.cpp b/samples/DOMPrint/DOMPrint.cpp
index f0d33744a77b6dbd169b82411a78f5897f42e951..650be8c5836a13511d5b367beb2ed027d43baa0c 100644
--- a/samples/DOMPrint/DOMPrint.cpp
+++ b/samples/DOMPrint/DOMPrint.cpp
@@ -431,7 +431,7 @@ ostream& operator<<(ostream& target, DOM_Node& toWrite)
 
         case DOM_Node::DOCUMENT_TYPE_NODE:
         {
-			DOM_DocumentType doctype = toWrite.getOwnerDocument().getDoctype();
+			DOM_DocumentType doctype = (DOM_DocumentType &)toWrite;;
 
 			target << "<!DOCTYPE " << nodeName ;
 			DOMString id = doctype.getPublicId();