Forum Moderators: open

Message Too Old, No Replies

XHTML target attribute

having trouble getting the target attribute to work!

         

zair

12:57 am on Aug 27, 2004 (gmt 0)

10+ Year Member



So, I've been trying my darnedest to add the target attribute through xhtml modularization. I have gotten it to work, and validate as XHTML 1.0 strict, which is darn good. However, now, no matter what I've tried I get the " ]>" characters (without quotes) at top of my screen. Here's the doctype I use...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
[ <!ATTLIST a target CDATA #IMPLIED> ]>

I have the MIME type set to...

<meta http-equiv="content-type" content="application/xhtml+xml; charset=iso-8859-1" />

However, I've noticed that my server still spits it out as html/text! (This was determined through the verbose output on the W3's validator).

How can I change the server so that it will spit out the right MIME type? But, more importantly, how can I still get it to work with IE (which doesn't support xhtml at all, when properly served) AND not have those darned characters at the top of the screen?

I found a php code sample from xml.com that allows it to distinguish between browsers because of the HTTP_ACCEPT header that browsers send out, but I am betting it will still put those characters up on the top of the screen in IE...

Any ingenious solutions?

Thanks,
Tobyn

isitreal

2:12 am on Aug 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I just switched one site to real XHTML 1.1, using the method you're trying to avoid, another has been running as XHTML 1 strict text/html but now delivers correct mimetype to validators, but you must set the headers using the type of scripts you are talking about, once the meta tag is set the header has already been sent, zero elements of your page can be sent before the header is set, there is not other way to do it.

The meta tag is useless, get rid of it. The Attlist thing not working in IE means that IE doesn't support that xhtml syntax, which it doesn't, I've also seen mozilla do this by the way, if you want to serve real xhtml you must use server side scripting, there's no other way practically speaking.

bull

5:42 am on Aug 27, 2004 (gmt 0)

10+ Year Member



RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml
RewriteCond %{HTTP_ACCEPT}!application/xhtml\+xml\s*;\s*q=0
RewriteCond %{REQUEST_URI} \.html$
RewriteCond %{THE_REQUEST} HTTP/1\.1
RewriteRule .* - "[T=application/xhtml+xml; charset=iso-8859-1]"

delivers only application/xhtml+xml when listed in HTTP_ACCEPT

zair

10:30 pm on Aug 27, 2004 (gmt 0)

10+ Year Member



hmmm... well, I know that my code is just fine XHTML, so perhaps I'll just wait til the future to switch it over, when it's a bit easier to do and more widely accepted! For now I guess it's XHTML 1.0 Transitional! ...stupid target attribute... ;)

Thanks!
Tobyn