This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 5285 - Validator ignores "xml-stylesheet" PI in XHTML 1.0/1.1 where's no link element
Summary: Validator ignores "xml-stylesheet" PI in XHTML 1.0/1.1 where's no link element
Status: NEW
Alias: None
Product: CSSValidator
Classification: Unclassified
Component: Parser (show other bugs)
Version: CSS Validator
Hardware: All All
: P3 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: qa-dev tracking
URL: http://dark-chiaki.net/test/00048689/
Whiteboard:
Keywords:
: 12632 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-11-26 15:05 UTC by Peter Neumann
Modified: 2012-06-11 13:41 UTC (History)
3 users (show)

See Also:


Attachments
Proposed patch for this issue. (1.12 KB, patch)
2009-05-15 17:58 UTC, William F. McCaw
Details

Description Peter Neumann 2007-11-26 15:05:26 UTC
I got a problem with the W3C CSS Validator while trying to validate a document (written in XHTML 1.0 Strict, served as application/xhtml+xml, encoding UTF-8, validated by W3C Validator) in wich the stylesheet is referenced with a XML processing instruction as follows:

<?xml-stylesheet alternate="no" href="URI" type="text/css" media="all" ?>

Since Firefox is cappable of this notation, the CSS Validator says
"No Errors or Warnings found. No Stylesheet found."
and validates nothing at all. The validation only works (and is successful), if I additionally include a reference with the link element as follows:

<link rel="stylesheet" href="URI" type="text/css" media="all" />

Occurs on any Platform/OS/UA, direct and with referer-link, used browsers are Firefox 2.0.0.9 and IE 7.0 (itself not cappable of XHTML, but doesn't change the failded validation).

To reproduce the error/failing, try to get a validation with:
http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.djg-muenchen.de%2F
(Page in german language, but this shouln't be relevant for testing.)

Best regards,
Peter Neumann
Comment 1 Peter Neumann 2008-01-13 17:46:22 UTC
Just as a side note:

This problem belongs also to XHTML 1.1 documents.

It seems, that the validator at the moment is unable
to detect and/or handle xml processing instructions at all,
if no <link> element and/or internal stylesheet is given.

Seems to be related to Bug #4105 and maybe Bug #2403.
(http://www.w3.org/Bugs/Public/show_bug.cgi?id=4105)
(http://www.w3.org/Bugs/Public/show_bug.cgi?id=2403)

Best Regards,
Peter Neumann
Comment 2 Peter Neumann 2008-04-07 05:41:36 UTC
Testlink provided in Description has changed:
>> http://dark-chiaki.net/test/00048689/
(XHTML 1.0 Strict, served as 'application/xhtml+xml; charset="utf-8"')

The earlier provided testpage has been rewritten to HTML 4.01 Strict,
as a result no XML Stylesheet-PI will be provided for the test anymore.

Best Regards,
Peter Neumann
Comment 3 William F. McCaw 2009-05-15 17:58:57 UTC
Created attachment 698 [details]
Proposed patch for this issue.

I also encountered this problem whilst attempting to validate a site I'm
building (XHTML 1.1, application/xhtml+xml and xml-stylesheet PIs) using
both the online validator, and the development version from CVS run from
the command line.

This patch makes the following change to the processingInstruction methods
of both the TagSoupStyleSheetHandler and the XMLStyleSheetHandler classes
within the org.w3c.css.css package.

* The local "mt" variable is assigned the MimeType instance created from
  the "type" pseudo-attribute of the xml-stylesheet PI.

Without this change, the validator does not see the specified URI as
referencing a CSS stylesheet, and so ignores it.

Best regards,
William F. McCaw.
Comment 4 byk_przemek 2011-05-11 05:47:20 UTC
*** Bug 12632 has been marked as a duplicate of this bug. ***