Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > XHTML strict

Reply
Thread Tools

XHTML strict

 
 
Jure Erznoznik
Guest
Posts: n/a
 
      04-19-2005
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,
Jure


 
Reply With Quote
 
 
 
 
Mitja
Guest
Posts: n/a
 
      04-19-2005
Zivjo

> 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.

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.

> Q1: The way I understand it, to separate data from presentation, I would
> have to use XSLT, wouldn't I?

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).

> 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!?!

Nope, the leading bytes (called byte order mark) are optional for UTF-8:
http://www.unicode.org/faq/utf_bom.html#22

> 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?

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">.

HTH,
Mitja
 
Reply With Quote
 
 
 
 
Spartanicus
Guest
Posts: n/a
 
      04-19-2005
"Jure Erznoznik" <(E-Mail Removed)> wrote:

>I've decided to reprogram my WEB app to XHTML for some of the benefits
>described in W3C documentation.


Make sure you can distinguish the facts from the myths first:
http://www.spartanicus.utvinternet.ie/no-xhtml.htm

>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?


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

>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


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".

>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).


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

--
Spartanicus
 
Reply With Quote
 
Jure Erznoznik
Guest
Posts: n/a
 
      04-19-2005
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
question.

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,
Jure

"Mitja" <(E-Mail Removed)> wrote in message newspspg0vnltdob4us@ibis...
> Zivjo
>
>> 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.

> 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.
>
>> Q1: The way I understand it, to separate data from presentation, I would
>> have to use XSLT, wouldn't I?

> 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).
>
>> 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!?!

> Nope, the leading bytes (called byte order mark) are optional for UTF-8:
> http://www.unicode.org/faq/utf_bom.html#22
>
>> 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?

> 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">.
>
> HTH,
> Mitja



 
Reply With Quote
 
Mitja
Guest
Posts: n/a
 
      04-19-2005
Top posting is frowned upon in this NG. Rather than typing Q1, Q2 etc.,
quote the appropriate parts, like so:

>>> 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?

>> 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">.

> 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.

Yeah, a custom DTD is a geeky option at best...

> But that raises another question of what to do when I need
> multiple such attributes...

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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing VS2005 to generate HTML 4.01/Strict instead of XHTML 1.0 Rob Roberts ASP .Net 5 01-20-2006 11:38 PM
XHTML Strict and Script Tom HTML 6 11-15-2003 07:12 PM
Need help with strict XHTML Brendan HTML 4 11-03-2003 01:49 PM
Announcing Limited Public Beta - XHTML 1.0 Strict Web Controls Peter L. ASP .Net 0 10-20-2003 08:14 PM
xhtml strict is being very stict why? Christopher R HTML 13 10-01-2003 07:17 PM



Advertisments