POV-Ray : Newsgroups : povray.off-topic : The trouble with XSLT : Re: The trouble with XML Server Time
29 Jul 2024 20:21:28 EDT (-0400)
  Re: The trouble with XML  
From: Invisible
Date: 27 Feb 2012 04:15:06
Message: <4f4b499a$1@news.povray.org>
On 26/02/2012 12:35 AM, Darren New wrote:
> On 2/25/2012 2:37, Orchid Win7 v1 wrote:
>> For example, to say "this XML file actually contains XHTML", you're
>> supposed
>> to add something like 5 separate headers, each about 25 million miles
>> long,
>> to the top of the file. Why? Would one header not be sufficient?
>
> 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" ?>

Which is fair enough, although the 5-digit ISO code number isn't exactly 
easy to remember. Then you have to say

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Yeah, I'm really going to remember that without looking it up. :-P No, 
you can't just say "this is XHTML". You really do have to write all that 
crap. And after /that/, you still have to say

<html xmlns="http://www.w3.org/1999/xhtml">

Um, didn't I just declare this as XHTML already? At least this URL is a 
bit shorter, I guess...

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.

>> Then there's all that stupidity with character entities. It should be
>> possible to include character entities in /all/ XML documents, not just
>> XHTML. But to this day, I have never discovered a way of doing this.
>
> You have to declare the entities. Otherwise, you run across &frump; and
> don't know what it means. That's what DTDs are for.

So why isn't there a DTD somewhere that contains all the entities that 
everybody uses, which I can just link to? More to the point, since 
everybody uses the same set of entities, why aren't they built in?

>> One of the nice ideas of XML is that you can use namespaces to include
>> one
>> sort of XML document inside enought - e.g., you could put an SVG file
>> inside
>> an XHTML file. But nooo, apparently you need a specialised DTD to do
>> that.
>
> You can. Of course, your various processors have to know what the
> various namespaces *mean*, so you have to declare them and you have to
> have a processor that understands them (which is where the DTDs come in).

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


Post a reply to this message

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