Need help with cryptic validator error message

***I'm not sure how to fix what I have to make my document valid based on what your validator said.  I tried getting rid of every version statement in my xslt, and it still had problems with the same thing, although it stated the problem a little differently.  Could you help?  My assignment is due today!

***This is what you do to execute it:

***This is the validator response (I don't know what to fix in my xsl document, and tried getting rid of all but the first line version statement and it didn't work):

alidation Output:
        1 Error

        Line 3, Column 5:
        XML Parsing Error:  XML declaration allowed only at the start of the document.<?xml version="1.0" encoding="UTF-8"?>
***This is my getUserTable2.php:



$xp = new XSLTProcessor();

//create a DOM document and load the XSL stylesheet
$xsl = new DOMDocument;

$xsl->load ('getuserTable.xsl');
//import the XSL stylesheet into the XSLT process

//create a DOM document and load the XML data
$xml_doc = new DOMDocument;

//transform the XML into HTML using the XSL file
$html = $xp->transformToXML($xml_doc)
or exit ( 'XSL transformation failed - ' . E_USER_ERROR );

  echo $html;


***This is my getUserTable.xsl:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="" version="1.0">
   <xsl:output method="xml" version="1.0" encoding="UTF-8" doctype-public="-//W3C//DTD XHTML 1.1//EN" doctype-system="" indent="yes"/> 

<xsl:template match="/">
 <html xmlns="" xml:lang="en">
   <title>Users and Groups</title>

    <h2>The Users and their Groups</h2>
    <table border="1">
      <xsl:for-each select="users/user">
          <td><xsl:value-of select="@name"/></td>
          <td><xsl:value-of select="data/group"/></td>


***And this is my domain.xml:

<?xml version="1.0" encoding="UTF-8"?>
<user id="1a" name="Mary Lamb">
   <user id="2a" name="Little Muffit">
   <user id="3a" name="Jack Jill">

***I hope you can help!  Thanks!


Received on Sunday, 8 March 2009 18:25:01 UTC