472,969 Members | 1,505 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,969 software developers and data experts.

CSS validation fails, can you help me figuring out what's wrong?

Hi,

I'm using phpWebSite to build my website and I want it to be standard
conforming. However, the CSS validator always outputs an error:

"Please, validate your XML document first!
The processing instruction target matching "[xX][mM][lL]" is not allowed."

The offending line is:
<?xml version="1.0" encoding="iso-8859-1"?>

The site is built in XHTML, but the HTML validator says it would be
valid XHTML 1.0!

Any ideas?

--
Matthias Kaeppler
Aug 9 '05 #1
9 1693
Matthias Kaeppler wrote:
However, the CSS validator always outputs an error:

"Please, validate your XML document first!
The processing instruction target matching "[xX][mM][lL]" is not allowed."

The offending line is:
<?xml version="1.0" encoding="iso-8859-1"?>


As you did not provide a URL, just a guess: Is there anything preceding
the XML declaration? Newline? Comment?
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Aug 9 '05 #2
Matthias Kaeppler wrote:

I'm using phpWebSite to build my website and I want it to be standard
conforming.


Good luck with that, you'll probably need it.

phpWebSite outputs a big mess of code, at least it did the last time I
gave it a spin. Lots of HTML style attributes mixed with inline styles
and external stylesheets. It's not very pretty.

Me thinks you'll have bigger fish to fry than passing validation.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Aug 9 '05 #3
Johannes Koch wrote:
As you did not provide a URL, just a guess: Is there anything preceding
the XML declaration? Newline? Comment?


That's right, this line is preceding the XML header:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

The document validates just fine on this DTD, but CSS doesn't, it won't
go past the XML version declaration.

--
Matthias Kaeppler
Aug 10 '05 #4
Matthias Kaeppler wrote:
That's right, this line is preceding the XML header:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Change the sequence:
1. XML declaration
2. Document type declaration.
The document validates just fine on this DTD,


That's because the W3C markup validator does not really know about XHTML
and XML in general.

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Aug 10 '05 #5
Johannes Koch wrote:
That's because the W3C markup validator does not really know about XHTML
and XML in general.


Nor should it (in general).

The web is not (yet) an XML medium. If you want to serve XHTML (don't
let me stop you) then you're best doing it as text/html under Appendix
C. This is perfectly reasonable to do and works fine.

However a validator encountering such a page has to treat it as an SGML
document (or an least non-XML HTML, where this varies from rigid SGML)
conforming to some mutant SGML DTD derived from the XHTML Schema. It
would be an error to treat it as an XML document and try to validate it
against XML rules, because that's not what you're serving it as.

Yes, the W3C validator doesn't do XML. If you serve XHTML _as_ XML
(with application/xhtml+xml) then you're going to see odd behaviours -
much as you may if you serve it like that to the web at large. In
particular, don't expect the W3C validator to validate it _as_ an XML
document - features like namespaces (for instance) just don't work.

This is not entirely unreasonable though. The W3C validator never
claims to be an XML validator, nor is (and this surprises many people)
an XHTML document an XML document, _if_it's_served_as_HTML_. Your
embedded RDF metadata with namespaces (and I'm the biggest culprit
around) is fine and dandy so long as your XHTML document still _is_
XML, but once you throw it out onto the web wearing the trousers of
HTML, then that namespacing is no longer valid. We know the old HTML
rules about ignoring unknown elements and just rendering their content
- these are enough to keep the embedded metadata "safe" for use
(there's an old last-century "RDF in HTML" note of Dan Brickley's on
just this topic) but while this "safe" "extended" HTML is perfectly
usable, it is no longer valid in the strict sense.

Aug 10 '05 #6
"Matthias Kaeppler" <no****@digitalraid.com> schreef in bericht
news:dd*************@news.t-online.com...
Hi,

I'm using phpWebSite to build my website and I want it to be standard
conforming. However, the CSS validator always outputs an error:

"Please, validate your XML document first!
The processing instruction target matching "[xX][mM][lL]" is not allowed."

The offending line is:
="1.0" encoding="iso-8859-1"?>

Delete the line, it fucks up your xhtml/css markup. Or, like Jeffrey Zeldman
puts it:
"Unfortunately, many browsers, even from 'nice' homes, can't handle their
XML prolog. After imbibing this XML element they stagger and stumble and
soil themselves, bringing shame to their families and eventually losing
place in society"
LOL

--
Niek
Aug 10 '05 #7
di*****@codesmiths.com wrote:
However a validator encountering such a page has to treat it as an SGML
document (or an least non-XML HTML, where this varies from rigid SGML)
conforming to some mutant SGML DTD derived from the XHTML Schema. It
would be an error to treat it as an XML document and try to validate it
against XML rules, because that's not what you're serving it as.
I see your point. But IMHO, a validating tool is not a general HTTP user
agent. I would prefer to have at least an option to validate an XHTML
document against XML rules because XHTML is an XML-based language,
regardless of the MIME type the document is sent with.
Your
embedded RDF metadata with namespaces


BTW, I'm not the OP.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Aug 10 '05 #8
On Thu, 11 Aug 2005 00:33:43 +0200, Johannes Koch
<ko**@w3development.de> wrote:
I see your point. But IMHO, a validating tool is not a general HTTP user
agent.
Agreed, although in general it ought to emulate the behaviour of one. A
tool that works differently would be misleading, and that's a bad thing.
I would prefer to have at least an option to validate an XHTML
document against XML rules
Again, agreed. One day we'll probably have one.

As it's an easier problem to solve, I already have several XML
validators that can happily validate my XHTML documents (today I'm
using XMLSpy, although I can't claim to like it)
because XHTML is an XML-based language,
regardless of the MIME type the document is sent with.


I disagree - as stated above. "based" is possible, but in the sense of
"acts as an example of" it's no longer true in the text/html case.
Your
embedded RDF metadata with namespaces


BTW, I'm not the OP.


I was speaking generally. Sometimes it feels as if I'm the only person
who embeds metadata in HTML.

Aug 10 '05 #9
> On Thu, 11 Aug 2005 00:33:43 +0200, Johannes Koch
<ko**@w3development.de> wrote:
I see your point. But IMHO, a validating tool is not a general HTTP user
agent.

Andy Dingley wrote: Agreed, although in general it ought to emulate the behaviour of one. A
tool that works differently would be misleading, and that's a bad thing.


Think of validating documents that are not sent via HTTP.

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Aug 11 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Darren | last post by:
I have a form that has 10 fields on it. I have made all of them "Required". I also am using vb if statements to decide whether or not each field should be on the page. I am using the vb to...
16
by: Hosh | last post by:
I have a form on a webpage and want to use JavaScript validation for the form fields. I have searched the web for form validation scripts and have come up with scripts that only validate...
2
by: AlexS | last post by:
Hello, I have error when reading schema using XmlSchema. Read and then .Compile: System.Xml.Schema.XmlSchemaException: May not be nominated as the {substitution group affiliation} of any...
2
by: Dalan | last post by:
This ought to be simple enough, but not certain which to use. I have a few fields set to Require data to be entered; however, the message displayed by Access 97 is too generic to be of any real...
11
by: tomrmgc | last post by:
I have a dll that was working in VC6, but isn't loading after being built in VC71. LoadLibrary() returns null and the error code (from GetLastError()) is -2147483645 "One or more arguments are...
1
by: John Stemper | last post by:
I'd like to have a validation control trigger another routine when the validation control returns invalid. The goal is to return focus to the control that fails the validation and clear any text...
27
by: Chris | last post by:
Hi, I have a form for uploading documents and inserting the data into a mysql db. I would like to validate the form. I have tried a couple of Javascript form validation functions, but it...
11
by: Rik | last post by:
Hello guys, now that I'm that I'm working on my first major 'open' forms (with uncontrolled users I mean, not a secure backend-interface), I'd like to add a lot of possibilities to check wether...
8
by: Bryan | last post by:
I want my business objects to be able to do this: class Person(base): def __init__(self): self.name = None @base.validator def validate_name(self): if not self.name: return
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
3
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.