![]() |
Validator xHTML + PHP - Wersja do druku +- Forum Webmastera, HTML, CSS, PHP, MySQL, Hosting, Domeny - Forum dla Webmasterów (https://www.webmastertalk.pl) +-- Dział: Technologie internetowe - tworzenie stron WWW (https://www.webmastertalk.pl/forum-technologie-internetowe-tworzenie-stron-www) +--- Dział: xHTML, CSS, JavaScript (https://www.webmastertalk.pl/forum-xhtml-css-javascript) +--- Wątek: Validator xHTML + PHP (/thread-validator-xhtml-php) |
Validator xHTML + PHP - rabbit404 - 04-05-2009 Witam wszystkich uzytkowników! ![]() Stworzyłem swoja pierwsza strone opieracjaca sie o xhtml oraz css i napotkałem pewien problem z validatorem xhtml. Kod zapisany został w pliku index.php w którym umieściłem funkcję <?php include('menu.php');?> odwołująca sie do menu na mojej stronie. Validator po sprawdzeniu pliku wywołuje jeden błąd: Line 37, Column 44: document type does not allow element "html" here <html xmlns="http://www.w3.org/1999/xhtml" > The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed). One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error). Usunąłem już sporo niezgodnosci kodu, lecz w tym przypadku nie mam pojecia co jest nie tak ;-) Poniżej przedstawiam kod źródłowy wyświetlany przez validator (połączone index.php + menu.php) Mam nadzieje ze wyjaśniłem się dosyć jasno by ocenić co jest przyczyną tego błędu. Kod: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" RE: Validator xHTML + PHP - Labsta.com - 04-05-2009 Bez obrazy, ale tekiego numeru jeszcze nie widziałem. Masz dwie sekcje <head> + jeszcze dodatkowy <html> Rozumiesz w czym rzecz? RE: Validator xHTML + PHP - rabbit404 - 04-05-2009 Tak, ale to są dwa odrębne pliki - Validator wyświetla taki kod (nie żebym nie wiedział że jest jedno head i html ![]() **EDIT** No i mam haka - dopiero co przerzuciłem sie z <iframe> na include, więc w myślałem ze w pliku menu.php również potrzebuje zaznaczniki. Myliłem się jednak - wywaliłem wszystkie zaznaczniki i działa. Czyżby temat do kasacji? RE: Validator xHTML + PHP - Labsta.com - 05-05-2009 No tak też myślałem, że może includowałaś cały html i dlatego ten bałagan się zrobił. |