Can I validate a page that already specifies schema or DTD at top?

I’m going to be working with pages that all have their schema or DTD
specified at the top such as:

Do I need to extract each one, or can I somehow run a version of
validate that picks this up instead of taking a dtd/schema object as an
argument?

xc