XML, XHTML, Text Structuring, and CSS

B

Blue

Could someone draw me a picture?

I have been writting a web site in XHTML 1.1 and CSS and since I have
already locked myself into standard supporting browsers(Gecko and
Opera mainly) I am wondering what's the point of XHTML and CSS? It
seems to me I could just write XML+CSS. I have to write the CSS file
anyway so what's the purpose of the XHTML format?

Looking at all the span's and div's I create I keep thinking I'd be
better off just creating my own tags. It would certainly look better.
And then I think, why am I using HTML tags anyway when if I just
create all the tags myself the documents would be simplier.

In reading up on XHTML everyone is stressing that HTML is suppose to
be about data structuring and not display. Fine, can someone give me
an example of how wonderful HTML is at data structuring?

Of course I understand XML and CSS have limitations but eventually
that won't be. What's HTML's purpose? Why should it be used to
create web pages? What's so great about using <p>, <h1>, and <ul>?
Using an origional XML format and a CSS file, browsers could do the
same thing.

I'm must be missing the point somewhere.
 
B

brucie

Could someone draw me a picture?

///\\
// \\
| - - |
C ) D
|\___/|
\___/
___| |___
/ \
/ '.` '.' \
/ | ` | \
/ /| . |\ \
/ / | ___ | \ \
/ / |//|||\\| \ \
((( ||||||||| ))=
|||||||||
|||||||||
///|||\\\
=(( |_| |_| )))
\ \ / \ / /
\ \/ \/ /
___\/_/\__:__/\_\/______
 
L

Leif K-Brooks

Blue said:
I have been writting a web site in XHTML 1.1 and CSS and since I have
already locked myself into standard supporting browsers(Gecko and
Opera mainly) I am wondering what's the point of XHTML and CSS? It
seems to me I could just write XML+CSS. I have to write the CSS file
anyway so what's the purpose of the XHTML format?

There are at least two reasons to use XHTML instead of your own XML format:

1. If you want anything but text (images and forms, for instance),
you'll have a pretty hard time with a custom format. You'll either have
to write your own browser or use very new standards which aren't
supported anywhere.

2. With a few hacks, modern XHTML+CSS can display nearly everywhere --
even Mosaic! Can your custom XML format do that?
 
K

kayodeok

In reading up on XHTML everyone is stressing that HTML is
suppose to be about data structuring and not display. Fine, can
someone give me an example of how wonderful HTML is at data
structuring?

This should start you on your way:
http://groups.google.com/groups?&[email protected]
http://www.google.com/search?q=semantic+shirky
Of course I understand XML and CSS have limitations but
eventually that won't be. What's HTML's purpose? Why should it
be used to create web pages? What's so great about using <p>,
<h1>, and <ul>? Using an origional XML format and a CSS file,
browsers could do the same thing.

Internet Explorer won't display your webpage (but I think the Gecko Browsers will).
 
T

Toby A Inkster

Blue said:
In reading up on XHTML everyone is stressing that HTML is suppose to
be about data structuring and not display. Fine, can someone give me
an example of how wonderful HTML is at data structuring?

HTML has *semantics* -- it attaches meaning to a document.

Blue's Random XML Document Format [TM] (BRXDF) does not have semantics.
OK, well it may do, but it's unlikely any browser understands them.

With an HTML document, a browser can use the semantics attached to the
document to do stuff. For example, create a document outline from the
headings:

http://www.goddamn.co.uk/tobyink/scratch/headings-in-dillo

Or automatically add section numbering:

http://www.goddamn.co.uk/tobyink/scratch/section-numbering-in-amaya

With a BRXDF document, a browser couldn't do that.
 
A

Andy Dingley

It seems to me I could just write XML+CSS. I have to write the CSS file
anyway so what's the purpose of the XHTML format?

Congratulations - you already are. XHTML is as much "XML" as anything
else.

It's impossible to write "pure XML". As soon as you write your first
element, you've chosen a DTD, even if this is informal and only
expressed by the document itself. If you use CSS, then you're relying
on this DTD being shared between the XML document and the CSS
stylesheet.

So your question really reduces to "When I write XML, should I use the
XHTML DTD or some other DTD of my own invention ?" Stated like this,
it's obvious that the "roll your own" approach is no _simpler_ than
using XHTML, because it's just not possible to reject DTDs altogether.

As to whether it's better, then I don't think so. XHTML has the
following advantages:

- It's supported by non-CSS browsers (and various other legacy
scenarios, including non-XML tag-soup browsers). The "Best viewed with
browser Foobar" approach is bad (posts passim.) Remember too that one
of the most important browsers around is a search engine's spider.

- CSS can't emulate links

- CSS can't emulate <img>, unless you go overboard with the id
attributes and also embed a lot of image URLs into the CSS, which
starts to encroach on being content rather than presentation.

- CSS only gets applied inside the <body> element. It helps you
naught for the stuff in <head>


Yes, you _can_ write your entire document with <p class="foo" >
<xhtml:span class="bar"> elements and use CSS to do the rest. But you
don't _gain_ anything by doing this over a more traditional HTML-like
approach with <p> and <h*>. You lose a lot of backward compatibility
too.


A few years back, I had a content assembly problem where I was
assembling lots of text stored as XML, then eventually outputting it
as HTML (and PDFs, SMIL and other things too). I published on this at
ICALT 2001 in Wisconsin. I started off with DocBook as my DTD, but in
the end I switched to XHTML. I was using very little other than <p
class="..." > and DocBook was offering me little useful in addition. I
could have invented my own DTD, but this was a lot more work, again
for little benefit (over using classes). Using XHTML from content to
published output was technically little simpler, but it did make the
code easier to read and be human-understandable.


BTW - If you do publish as XML, then don't stop at CSS. You really
don't start to gain real advantages until you're using XSLT.
 
T

Toby A Inkster

I think you underestimate the power of CSS.

Andy said:
- CSS can't emulate <img>, unless you go overboard with the id
attributes and also embed a lot of image URLs into the CSS, which
starts to encroach on being content rather than presentation.

You might be able to do:

<myImg mysrc="blah.png" />
myImg:before { content: url(attr(mySrc)); }

Although I'm not sure.
- CSS only gets applied inside the <body> element. It helps you
naught for the stuff in <head>

Not true.

head { display: block; }
head * { display: none; }
head title { display: block;
color: red; background: blue;
text-align: center; font-size: 1.8em; }
 
J

Jukka K. Korpela

Leif K-Brooks said:
2. With a few hacks, modern XHTML+CSS can display nearly everywhere
-- even Mosaic! Can your custom XML format do that?

Indeed - with some trickery and hackery, XHTML is almost as useful as
HTML 4!
 
J

Jukka K. Korpela

Andy Dingley said:
It's impossible to write "pure XML".

It isn't. Here's a proof:

<foo>Hello world</foo>

That's pure XML. I just wrote it.
As soon as you write your
first element, you've chosen a DTD,

No, I haven't. See, no DTD:

even if this is informal

There's no such thing as an informal DTD - that's a real oxymoron, like
a rectangular circle.
and only expressed by the document itself.

I don't see what you mean by that. A DTD can be included into a
document or referred to by the document. The difference between these
two only matters (apart from practical efficiency considerations)
only misguided doctype sniffers.
If you use CSS, then you're
relying on this DTD being shared between the XML document and the
CSS stylesheet.

No, I'm not.

<?xml-stylesheet type="text/css" href="test.css"?>
So your question really reduces to "When I write XML, should I use
the XHTML DTD or some other DTD of my own invention ?"

Does it? If that's the question, then the answer simply depends on
whether you are using XHTML or not.
Stated like
this, it's obvious that the "roll your own" approach is no
_simpler_ than using XHTML, because it's just not possible to
reject DTDs altogether.

It is. And if you use a DTD, then XHTML DTDs are not the only existing
DTDs to choose from.
As to whether it's better, then I don't think so. XHTML has the
following advantages:

I think you are making some (good) points on the benefits of HTML over
markup (SGML or HMTL) without publicly specified semantics and
widespread browser support. The "X" prefix just causes confusion here.
 
J

Jukka K. Korpela

Blue said:
I have been writting a web site in XHTML 1.1 and CSS

Why XHTML 1.1? The whole specification is an exercise in futility and
deprives you of things that are useful on the Web of today and the near
future. And the browser that is by far the most common on the Web
chokes on XHTML 1.1 when served in the recommended way.
and since I
have already locked myself into standard supporting browsers(Gecko
and Opera mainly) I am wondering what's the point of XHTML and CSS?

Pardon? You have dug yourself into a hole where only a small avantgarde
minority can access your pages, and now you are asking why you did
that?
It seems to me I could just write XML+CSS. I have to write the CSS
file anyway so what's the purpose of the XHTML format?

Oh. So you are now asking how to dig deeper. The avantgarde of the
avantgarde is already using user style sheets that may override
anything you say in your style sheet. So even they will find your pages
inaccesible.
I'm must be missing the point somewhere.

Now that's something to agree on. There's some scent of trolling in the
air, but I think you are serious - and seriously misguided. It's so sad
to see how right I was in my article "Lurching Toward Babel: HTML, CSS,
and XML", Computer, July 1998 (!),
http://www.computer.org/computer/co1998/pdf/r7103.pdf
where I warned:
"The XML metalanguage can define the
formal syntax of a language, such as nesting
rules for elements. The semantics could
of course be described in plain English. But
this doesn’t seem to be of interest to XML
evangelists. They are more interested in
just specifying presentation with CSS.
Naturally, this means that they do not use
CSS as a presentation suggestion only,
since (with the XML/CSS model) there is
no default or user-defined presentation."
and
"As a publishing method, XML/CSS is
comparable to using text processing
software with styles or macros:"
That is, it means a huge leap - into the bad old times
before the ideas of platform, device and program independence.
 
A

Andy Dingley

It isn't. Here's a proof:

<foo>Hello world</foo>

That's pure XML. I just wrote it.

No, that has an "implicit DTD" which includes the use of the element
"foo".

Now any term such as "implicit DTD" is obviously wrong, but I'm too
tired and lazy to think of a better one. I'm not implying anything
DTD-like here, just the informal and undocumented implicit usage that
you get as soon as you use the first element with a name (and as
well-formed XML always needs a root, then you always have to do this).

You're smart enough to understand what I mean. _You_ think of a better
expression for it, if you think an alt group is worth it.
 
A

Andy Dingley

They are more interested in
just specifying presentation with CSS.

Who is "they" ? Who is this mythical cabal who are pushing XML for
presentational tasks like this, and how many of them are foolish
enough to think that pure XML+CSS can offer anything ?

Where was this published ? The Daily Mail ? It reads like their style
- FUD about an invented threat from strange foreign chaps (who
probably have beards and wear funny clothes).
 
B

Blue

///\\
// \\
| - - |
C ) D
|\___/|
\___/
___| |___
/ \
/ '.` '.' \
/ | ` | \
/ /| . |\ \
/ / | ___ | \ \
/ / |//|||\\| \ \
((( ||||||||| ))=
|||||||||
|||||||||
///|||\\\
=(( |_| |_| )))
\ \ / \ / /
\ \/ \/ /
___\/_/\__:__/\_\/______

What on gods earth are happening with his feet?
 
B

Blue

1. If you want anything but text (images and forms, for instance),
you'll have a pretty hard time with a custom format. You'll either have
to write your own browser or use very new standards which aren't
supported anywhere.

Yes CSS3 isn't a standard yet but it's getting there and mozilla
already has some functionality. It's not there yet but the main point
of the point is to assume it was, what's HTML's selling point? Maybe
if HTML looked something like docbook with it's structuring I would
see a reason to use it. I don't understand why W3 bothers with HTML
beyond XHTML 1.0 aka HTML 4.01. It seems to be they should have
started something else, what they claim HTML should have been. The
XTHML documents talk about HTML ment to be a structuring format, how
many people buy that?
2. With a few hacks, modern XHTML+CSS can display nearly everywhere --
even Mosaic! Can your custom XML format do that?

Why should *I* want that for my rinky dink little page? Only
marketing companies care about that sort of thing. No offence but do
you really think I care about the 0.000001% of people using Mosaic?
Or even netscape 4? I might care about IE6 but after a long while
thinking it over I decided I really don't..

The main point is assume there was only one browser and everything
worked. What's so great about XHTML as it currently is or where it's
going to continue useing it?

HTML to me has ALWAYS been about presentation and evidently to you too
as you care how your pages "look" on each and every user agent. But
the people in charge of it have different ideas. They talk about it
as if it were something that looked like docbook.

P.S. I'd love to see a search engine be able to seperate pages based
on browser compatability. It's another way to seperate the chaf fromt
the wheat.
 
B

Blue

Blue said:
In reading up on XHTML everyone is stressing that HTML is suppose to
be about data structuring and not display. Fine, can someone give me
an example of how wonderful HTML is at data structuring?

HTML has *semantics* -- it attaches meaning to a document.

Blue's Random XML Document Format [TM] (BRXDF) does not have semantics.
OK, well it may do, but it's unlikely any browser understands them.

With an HTML document, a browser can use the semantics attached to the
document to do stuff. For example, create a document outline from the
headings:

http://www.goddamn.co.uk/tobyink/scratch/headings-in-dillo

Or automatically add section numbering:

http://www.goddamn.co.uk/tobyink/scratch/section-numbering-in-amaya

With a BRXDF document, a browser couldn't do that.

Again I mean no offence but you really think I need to do that? How
often do views do that? The only one I see doing something like that
is the author. And I can perfectly well do that using a language with
an XML module looking for analogous heading tags. If you strip out
all the presentational stuff your left with what was displayable in
Mosiac. How many sets of tags is that? Have you looked at them? How
much contextual information can you infer from they and what
percentage of web sites over the years have used them that way?

My whole point I think is, like it or not HTML is presentatial and the
W3 has been smoking something sometihng doped with some bad stuff if
they they HTML is structural.

HTML 1.0 is good. It's gives a way to transform pages into HTML if
that's what you want. They should have given XHTML over to
presentational people to evolve and the structural people should have
formed a new group rather than hijacking HTML.

But that's how I see it, no one agree, where have I missed something?
I feel like I'm missing something.

P.S. I really do thank you all for replying. I know I sound irate
but that's how I feel right now about this subject, not about any of
you.
 
B

Blue

Congratulations - you already are. XHTML is as much "XML" as anything
else.

Duh. Sematics, how clever. (Sorry, I couldn't help myself)
It's impossible to write "pure XML". As soon as you write your first
element, you've chosen a DTD, even if this is informal and only
expressed by the document itself. If you use CSS, then you're relying
on this DTD being shared between the XML document and the CSS
stylesheet.

So your question really reduces to "When I write XML, should I use the
XHTML DTD or some other DTD of my own invention ?" Stated like this,

So it is.
it's obvious that the "roll your own" approach is no _simpler_ than
using XHTML, because it's just not possible to reject DTDs altogether.

You off on a tangent as I'm not trying to reject DTDs. We're talking
about HTML aka XHTML and where it's going, namely XHTML 2.0 and
beyond. I have no problem with XHTML 1.0 so documents can be
transformed into HTML 4.01.
As to whether it's better, then I don't think so. XHTML has the
following advantages:

- It's supported by non-CSS browsers (and various other legacy
scenarios, including non-XML tag-soup browsers). The "Best viewed with
browser Foobar" approach is bad (posts passim.) Remember too that one
of the most important browsers around is a search engine's spider.

- CSS can't emulate links

- CSS can't emulate <img>, unless you go overboard with the id
attributes and also embed a lot of image URLs into the CSS, which
starts to encroach on being content rather than presentation.

This in neither here no there but I have read somewhere that in XHTML
2.0 the <img> might be removed and relagated to the object tag. How's
that for compatability? Furthermore HTML 2.0 isn't compatabile at all
with legacy user agents because the http mime has to be
application/xhtml+xml and from what I have read all legacy browsers
choke on it.
- CSS only gets applied inside the <body> element. It helps you
naught for the stuff in <head>


Yes, you _can_ write your entire document with <p class="foo" >
<xhtml:span class="bar"> elements and use CSS to do the rest. But you
don't _gain_ anything by doing this over a more traditional HTML-like
approach with <p> and <h*>. You lose a lot of backward compatibility
too.


A few years back, I had a content assembly problem where I was
assembling lots of text stored as XML, then eventually outputting it
as HTML (and PDFs, SMIL and other things too). I published on this at
ICALT 2001 in Wisconsin. I started off with DocBook as my DTD, but in
the end I switched to XHTML. I was using very little other than <p
class="..." > and DocBook was offering me little useful in addition. I
could have invented my own DTD, but this was a lot more work, again
for little benefit (over using classes). Using XHTML from content to
published output was technically little simpler, but it did make the
code easier to read and be human-understandable.

Finally something of substance but you skipped some details. While I
could ask about the detail you left out I'll instead ask for a URL
(until I actually use a URN I will not use the term URI).

I have to make assumptions for now and probabbly get it wrong. You
used XHTML for source and transformed documents. You were mostly
using p-class in it sounds like in both source and destination. Hence
you really weren't using structural HTML but rather you own embeded
markup via class declarations. You own your own implied DTD. What
did it get you? You can read it in both Mosiac and Netscape 4 if you
have to. Did you realy need that ability?
BTW - If you do publish as XML, then don't stop at CSS. You really
don't start to gain real advantages until you're using XSLT.

Of course. I already use XSLT. But if one creates simple web pages
full of text, like most web pages, you don't really need it.


Thanks for your reply.
 
B

Blue

I think you underestimate the power of CSS.



You might be able to do:

<myImg mysrc="blah.png" />
myImg:before { content: url(attr(mySrc)); }

Although I'm not sure.


Not true.

head { display: block; }
head * { display: none; }
head title { display: block;
color: red; background: blue;
text-align: center; font-size: 1.8em; }

I'm not sure how Gecko and other browsers currently implement HTML but
part of my implied point is eventually it will mostly be a default
overrideable CSS docuement. Probably with a few hacks for things not
in the CSS standards yet.
 
B

Blue

No, I haven't. See, no DTD:
LOL

I don't see what you mean by that. A DTD can be included into a
document or referred to by the document. The difference between these
two only matters (apart from practical efficiency considerations)
only misguided doctype sniffers.


No, I'm not.

<?xml-stylesheet type="text/css" href="test.css"?>
<foo>Hello world</foo>

Don't be too rough with him. We all know what he ment.
Does it? If that's the question, then the answer simply depends on
whether you are using XHTML or not.


It is. And if you use a DTD, then XHTML DTDs are not the only existing
DTDs to choose from.


I think you are making some (good) points on the benefits of HTML over
markup (SGML or HMTL) without publicly specified semantics and
widespread browser support. The "X" prefix just causes confusion here.

I agree. But the question is, what's so great about HTML in and of
itself, if browser support is irelevent. I only care that there is at
least one browser that can display what I create. If it takes two
different views to look at a HTML site I create and a XML site I
create then so be it. The question is what is so intrinsicly better
about HTML+CSS over XML+CSS? I already acknowledged that CSS indeed
does have a little bit further to go for full functionality but
everything else being equal what's so much better about HTML?
 
B

Blue

Why XHTML 1.1? The whole specification is an exercise in futility and
deprives you of things that are useful on the Web of today and the near
future. And the browser that is by far the most common on the Web
chokes on XHTML 1.1 when served in the recommended way.

IE doesn't care about me so I don't care about IE. I'm not selling
anything or pushing a religion. I really don't care how many people
using older browsers can read what I have written so long as new user
agents can or at least can be adapted to easily.

Frankly. XHTML 1.0 should be served as application/xhtml+xml. That
MS hasn't pached IE for this or that it just doesn't ignore the http
mime type is beyond me even if their XHTML and XML are wrong.
Personally I think it's just a strategy to build up Gecko and Opera's
market share a bit to help refute monopoly claims. But that's neither
here nor there.

XHTML 1.0 and 1.1 for that matter are both good things. (And as a
side note you can still have frames in 1.1 if you write a DTD driver
for it like I did or just ignore the DTD and just use those tags
anyway.) They are important so that proprietary server side HTML (as
XML) can be efficiently be transformed into more or less traditional
HTML without too much CPU strain.

But the XHTML 2.0 spec and the direction they are going is part of my
posting. Why didn't they just start over with a new name and format
from scratch? HTML failed as a structural language early in it's
life. It IS a presentational language.
Pardon? You have dug yourself into a hole where only a small avantgarde
minority can access your pages, and now you are asking why you did
that?

No I'm asking why am I bothering with this XHTML hole when the XML
hole looks so much more cozy.
Oh. So you are now asking how to dig deeper. The avantgarde of the
avantgarde is already using user style sheets that may override
anything you say in your style sheet. So even they will find your pages
inaccesible.

No more like they would just choose to read the text source which if I
do my job correctly would be more plesent than reading HTML.
I'm must be missing the point somewhere.

Now that's something to agree on. There's some scent of trolling in the
air, but I think you are serious - and seriously misguided. It's so sad
to see how right I was in my article "Lurching Toward Babel: HTML, CSS,
and XML", Computer, July 1998 (!),
http://www.computer.org/computer/co1998/pdf/r7103.pdf

Actually you the type of person I was looking for a responce from as
your one of the supposed structural HTML people.

An interesting read and quite relevent but I don't come to your
conclusion. You missed the point of XML. XML is an ackknowledgement
of all the proprietary extentions that were going to and did happen to
HTML like it or not. And it's a beautiful thing as it's allows
standards and proprietary implimentations to co exist. It alows the
w3 to enforce it's semantics so that individual user agents like
Internet Explorer can't claim they are following the standard or show
a good reason why they have to not follow it. And guess what,
developement of IE and has gone down the drain since.
where I warned:
"The XML metalanguage can define the
formal syntax of a language, such as nesting
rules for elements. The semantics could
of course be described in plain English. But
this doesn’t seem to be of interest to XML
evangelists. They are more interested in
just specifying presentation with CSS.
Naturally, this means that they do not use
CSS as a presentation suggestion only,
since (with the XML/CSS model) there is
no default or user-defined presentation."
and
"As a publishing method, XML/CSS is
comparable to using text processing
software with styles or macros:"
That is, it means a huge leap - into the bad old times
before the ideas of platform, device and program independence.

To be quite frank you have it backward. I'm actually more interested
in structure and I'm saying that HTML 4.01 isn't structural enough.
I'm saying that I use p-class statements much as if I was designing my
own html tags. I use it as psuedo XML. So why not go there? The big
question: What is so darn great about HTML? To me the only reason to
use it is for presentation but I can use CSS for the most part for
that. And if I want even more structure I can use XML+XMLT+CSS if I'm
willing to embrace curreently bleeding edge browsers.

Custom Structural XML -> XSLT -> Presentational XML+CSS

What's so really bad that? When an adequate advanced structural format
comes along I can later embrace that.

Or for really basic pages to introduce my dog Togo why not just a
basic simple structural and presentational XML + CSS. We're talking
about a page less than 1K in size here.

P.S. Just to make it clear I don't really have a dog Togo.
 
B

Blue

Who is "they" ? Who is this mythical cabal who are pushing XML for
presentational tasks like this, and how many of them are foolish
enough to think that pure XML+CSS can offer anything ?

Where was this published ? The Daily Mail ? It reads like their style
- FUD about an invented threat from strange foreign chaps (who
probably have beards and wear funny clothes).

I have to agree here. I'm probably among the few dozen, if that many,
to actually REALLY contemple doing it, though I think I can remember a
few articles saying it was possible, I can't say they were advocating
it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top