The proper order is to have the PI ("Processing Instruction"; the "<?" thingy) before the root element.Also, for a validator to recognize your declarations, the namespaces everywhere need to match. In this case, your elements are not in a namespace, so the "noNamespaceSchemaLocation" is the proper attribute to use, i.e.
<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type="text/xsl" href="prob12.34d.xsl"?><ArtistListxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:noNamespaceSchemaLocation="prob12.34d.xsd">
You're not supposed to see both the data and the formatted HTML... The PI is used exactly to tell the browser to hide the data in favor of whatever the result of the XSLT transformation is (which in your case is an HTML page, but could be an SVG instead for example).Also, no browser does either DTD or Schema validation, so you're not going to get any schema related errors in a browser. For that, you'd need to use the server. e.g. PHP's DOMDocument::schemaValidate() which, as you might be guessing, ignores your XML declaration too. So what's the point of that declaration you ask? IDEs - they can offer you auto completion based on the declared schema, and some can even validate your document "on the fly", and tell you an element is invalid at that location as soon as you write it out.