POV-Ray : Newsgroups : povray.off-topic : The trouble with XSLT : Re: The trouble with XML Server Time
29 Jul 2024 20:12:35 EDT (-0400)
  Re: The trouble with XML  
From: Invisible
Date: 29 Feb 2012 04:24:19
Message: <4f4deec3@news.povray.org>
>>> Really? What do you have to add? I suspect you exaggerate a bit.
>>
>> First, you must say
>>
>> <?xml version="1.0" encoding="ISO-8859-1" ?>
>
> You have to do that for XML anyway, so you don't have to do that for
> "this contains XHTML."

Well, that at least is true enough.

>> Which is fair enough, although the 5-digit ISO code number isn't exactly
>> easy to remember.
>
> I guess if you don't do it often you don't already have such memorized. :-)

I don't generally make a habit of memorising long code numbers, no.

>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>
> Right. That's the one line that you need to make it xhtml.

Well, it's more like 3 lines. :-P

>> And after /that/, you still have to say
>>
>> <html xmlns="http://www.w3.org/1999/xhtml">
>
> Er, no, you don't, unless you want an "html" namespace in your XML. If
> you don't want to use anything *except* html in your html document, you
> don't need this line.

The W3C validator disagrees.

The above declaration sets the default namespace for any elements which 
do not have a namespace explicitly declared. W3C seems to insist that 
this is /required/, even though a doctype has already been given.

(For example, my personal web pages do not have this third declaration. 
When I wrote them, the validator accepted them. Today, it rejects them 
because of the missing third declaration. Gotta love how a set of 
standards compliant pages are no longer compliant with the same 
standard, even though the pages haven't changed...)

>> In short, that's a /hell/ of a lot of typing, before I've even written my
>> document. It's also a lot of typing that I have to go look up on three
>> different websites every single damned time I want to write XHTML.
>
> So, store it somewhere.

That's what I end up doing. And then every time I go to a different 
computer, I have to look it up all over again.

>> So why isn't there a DTD somewhere that contains all the entities that
>> everybody uses, which I can just link to?
>
> There is. That's what the <!DOCTYPE> tag you complain about is doing.
> It's linking to the entities for xhtml. See that ".dtd" on the end of
> the URL?

It's linking the entire definition of the XHTML language, not just the 
character entities.

As far as I know, there is no way of using XHTML entities without also 
declaring that this is an XHTML document. If just the entity definitions 
were in a separate DTD, you could maybe do it. (But even then, I have a 
sinking feeling you can only have one DTD per document, so you'd still 
be stuffed.)

>> More to the point, since everybody
>> uses the same set of entities, why aren't they built in?
>
> Because they don't. Only the people using XHTML use that set of
> entities, and you complain about having to supply the URL to them. :-)

Well, 3 URLs. :-P

>> You would /think/ you could just say "hey, this stuff here is in the
>> XHTML
>> namespace, this stuff here is in the SVG namespace", and that would work.
>> But it doesn't. You need to use a DTD specially written for the exact
>> combination of XHTML+SVG.
>
> http://www.rpbourret.com/xml/NamespacesFAQ.htm#valid_2

I'm not sure what this is trying to say.

I know that you /can/ stuff more than one namespace into an XML 
document. It's just that it doesn't /work/ when you try to use it.

> Plus, things like SOAP wouldn't work at all, where you're embedding an
> arbitrary XML inside another arbitrary XML and expecting the processor
> of the latter to be able to understand the former without change.

Didn't we just...? Oh wait, that's SOPA. Never mind.

>> To me, this indicates that the system is
>> fundamentally broken. It should not be necessary to write a separate
>> DTD for
>> every possible combination of XML documents imaginable. You should
>> just be
>> able to refer to the DTD for XHTML and the DTD for SVG and have it work.
>
> http://www.rpbourret.com/xml/NamespacesFAQ.htm#use_5

I still don't follow.

> The basic problem is that you still have to define how the bits combine.
> Can you attach XHTML color declarations to color svg shapes? Can you use
> svg shapes as the shape for bullet points in a bulletted list? If you
> combined a vcard with xhtml, would you be allowed to nest a html:hr
> element inside the street address element of a vcard? Without a DTD that
> says the allowable combinations, there's no way to validate a complete
> document against a DTD.

Isn't that the purpose of the HTML <object> tag though? So it can 
contain an arbitrary object? If you just state that <object> is the only 
place where elements from another namespace can go, the problem is solved.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.