XHTML strict

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I've decided to reprogram my WEB app to XHTML for some of the benefits
described in W3C documentation.
While studying the documentation, I noticed a particular line which said
somethink like: If you wish to separate data from presentation, use strict,
otherwise use transitional.

While my documents work just fine using strict, I'm not really separating
data from presentation. The documents look almost exactly like they looked
in HTML 4.0 transitional I used before.
Q1: The way I understand it, to separate data from presentation, I would
have to use XSLT, wouldn't I?
I really don't want to do this since I have multiple data sets on each page.
I like them separated in the code the way they currently are. I would also
like to eventually support other browsers beside IE 6 and Firefox 1 I am
currently testing for and I really don't think XSLT is the way to do that.

Also, I'm having trouble with validator.w3.org:

Q2: Since it is a multilanguage app, I have all the docs UTF-8 encoded.
UTF-8 kinda requires 3 lead bytes to tell the reader how the file is
encoded, but validator says (error in document) that I should avoid those 3
bytes. I can of course do that, but then I would break UTF-8 rules!?!

Q3: Additionally, I have a problem with tables: I made myself a JavaScript
table object which allows me to interactively show SQL queries in HTML
tables (through some XML / PHP / SOAP). Anyway, for this object to work
correctly, I have to tell it each field's unique value, which I do through a
<TR> attribute "uniqueid". (<tr uniqueid="xxx"><td........</tr>) Of course,
the validator is not particulary happy about this attribute since it is
unknown. Is there any other way to have this information in the table in a
valid form?

Thanks in advance,

Re: XHTML strict

Zivjo :)

Quoted text here. Click to load it
Perhaps the other way round: if you really don't want to / can't separate  
data and style, use transitional. If you want them separated, both  
transitional and strict will do, though. It's just that strict more or  
less of forces you to do it.

Quoted text here. Click to load it
XSLT is a generic style markup language, used for generic XML. You use  
XHTML, which is a subset, so css is fine and preferred. (Hm... preffered?  
I'm not exactly at home with XML, but I think XSLT isn't even a proper  
substitute for CSS. What you can do with XSLT, AFAIK, is transform it into  
a (possibly CSS-enhanced) XHTML file).

Quoted text here. Click to load it
Nope, the leading bytes (called byte order mark) are optional for UTF-8:

Quoted text here. Click to load it
Two ways: you can (a) write your own DTD which allows the uniqueid  
attribute or, much better, you can (b) use the standard id attribute, as  
in <tr id="foo">.


Re: XHTML strict

Zivjo }:-))

Q1: As I understand Spartanicus, it seems the data / presentation is meant
in a sense of display properties eg. do everything in css. <table> tag is
not ment as a presentation part, only width attribute is (talking generally,
replace table(data) / width(presentation) with anything).
XSLT is as you said (a transformation of XML to CSS enhanced XHTML). It was
my poor understanding of data / presentation terms that lead to this entire

Q2: Thanks. It's been long since I last read the standard.
Q3: Maybe id attribute will really be fine. I was afraid to use it since it
means quite a lot in the standard itself. I don't think writing my own DTD
would be sane. But that raises another question of what to do when I need
multiple such attributes...

Thanks again,

Quoted text here. Click to load it

Re: XHTML strict

Top posting is frowned upon in this NG. Rather than typing Q1, Q2 etc.,  
quote the appropriate parts, like so:

Quoted text here. Click to load it
Yeah, a custom DTD is a geeky option at best...

Quoted text here. Click to load it
Then HTML is not suited for it. Let us know more about the background,  
about what you want to achieve and how you currently implement it. The  
answer will most probably be a slightly different and more elegant  
approach avoiding your current problems.

Re: XHTML strict

Quoted text here. Click to load it

Make sure you can distinguish the facts from the myths first:

Quoted text here. Click to load it

First make sure that you use HTML to correctly structure and
semantically mark up your documents, use CSS for all things

Quoted text here. Click to load it

Document encoding should be transmitted before the client starts to
receive it, this should be done by sending out the http content-type
header, example: "Content-Type: text/html; charset=utf-8".

Quoted text here. Click to load it

Javascript should never be relied upon, your solution will fail if js is
not available or not enabled.


Site Timeline