W3C home > Mailing lists > Public > www-validator@w3.org > March 2009

Need help with cryptic validator error message

From: Michele Cleary <clearlymichele@yahoo.com>
Date: Sat, 7 Mar 2009 08:21:47 -0800 (PST)
Message-ID: <420188.95522.qm@web32004.mail.mud.yahoo.com>
To: "www-validator@w3.org" <www-validator@w3.org>
***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:

http://lyle.smu.edu/~mcleary/a4/getUserTable2.php

***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:


<?php
//phpinfo();

error_reporting(E_ALL);
ini_set("display_errors","1");

$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
$xp->importStyleSheet($xsl);

//create a DOM document and load the XML data
$xml_doc = new DOMDocument;
$xml_doc->load('domain.xml');

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

  echo $html;

return;
?> 


***This is my getUserTable.xsl:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
   <xsl:output method="xml" version="1.0" encoding="UTF-8" doctype-public="-//W3C//DTD XHTML 1.1//EN" doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" indent="yes"/> 

<xsl:template match="/">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
 <head>
   <title>Users and Groups</title>
 </head>

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

</xsl:stylesheet>

***And this is my domain.xml:

<?xml version="1.0" encoding="UTF-8"?>
<users>
<user id="1a" name="Mary Lamb">
       <data>
           <group>JackJohnson</group>
           <youtube>http://tinyurl.com/ajoc8r</youtube>
           <mp3>http://www.mp3raid.com/search/mp3/jack_johnson.html</mp3>
           <rssfeeds>http://www.fiercepoet.com/index.php/weblog/2005/05/</rssfeeds>
           <news>http://blogs.thenewstribune.com/ej/2008/03/03/jack_johnson_set_to_rock_the_gorge</news>
       </data>
   </user>
   <user id="2a" name="Little Muffit">
       <data>
           <group>SarahBrightman</group>
           <youtube>http://tinyurl.com/cdy4cq</youtube>
           <mp3>http://www.mp3raid.com/search/mp3/sarah_brightman.html</mp3>
           <rssfeeds>http://noolmusic.com/search_videos/sarah_brightman</rssfeeds>
           <news>http://artsblog.freedomblogging.com/2008/12/17/sarah-brightman-disses-her-high-f/5144/</news>
       </data>
   </user>
   <user id="3a" name="Jack Jill">
       <data>
           <group>UB40</group>
           <youtube>http://tinyurl.com/bsxknz</youtube>
           <mp3>http://www.mp3raid.com/search/mp3/ub40.html</mp3>
           <rssfeeds>https://www.freebase.com/view/en/ub40</rssfeeds>
           <news>http://www.pop-music.com/article1277.html</news>
       </data>
   </user>
</users>

***I hope you can help!  Thanks!

Michele




      


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

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:34 GMT