Update filter.js

Added a check whether "DTD[ parent.name ]" exists, before accessing "DTD[ parent.name ] && DTD[ parent.name ][ child.name ]".
Otherwise, if you have some exotic tag in your HTML, the scripts would throw an exception.