Fix #1 parseDocument now correctly passes the resource