POV-Ray : Newsgroups : povray.off-topic : XML rant Server Time
5 Sep 2024 19:24:25 EDT (-0400)
  XML rant (Message 6 to 15 of 15)  
<<< Previous 5 Messages Goto Initial 10 Messages
From: Orchid XP v8
Subject: Re: XML rant
Date: 21 Jun 2009 14:52:46
Message: <4a3e817e$1@news.povray.org>
Warp wrote:

>   I never understood why the closing tag must be named. What's the point?

A tiny increase in the ability to handle or at least detect malformed XML.

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Warp
Subject: Re: XML rant
Date: 21 Jun 2009 14:57:00
Message: <4a3e827c@news.povray.org>
Orchid XP v8 <voi### [at] devnull> wrote:
> Warp wrote:

> >   I never understood why the closing tag must be named. What's the point?

> A tiny increase in the ability to handle or at least detect malformed XML.

  Why should a program be able to try to guess what a malformed XML file
might be trying to say? There's no way of unambiguously tell what the
properly-formatted version would have looked like.

  And if the XML file is malformed, it means that a person wrote it by hand.
Wouldn't it be better to directly tell the person that there's a mistake in
the file, rather than try to hide it, and possibly interpret it wrongly?

-- 
                                                          - Warp


Post a reply to this message

From: Darren New
Subject: Re: XML rant
Date: 21 Jun 2009 18:04:15
Message: <4a3eae5f@news.povray.org>
Warp wrote:
> Darren New <dne### [at] sanrrcom> wrote:
>> He makes a good point that
>> <integer>0</integer>
>> is a dumb-ass way of encoding data. :-)
> 
>   I never understood why the closing tag must be named. What's the point?

The point is to make it easy to check the data is formatted correctly.

In SGML, you could omit the closing tags when it wasn't ambiguous. If your 
DTD said paragraphs cannot nest inside paragraphs, you could write

<p> first paragraph <p> second paragraph <p> third paragraph <section> next

just like you could in the very first versions of HTML.

XML tried to "simplify" it, but of course they simplified it for the writer 
of the XML parser, rather than for the author of the XML data. SGML also 
required a DTD, while XML can be parsed without.

Of course, you could just have </> mean "close the most recent tag that 
hasn't been closed", and then you're really close to having s-expr's. ;-)

>   I have always felt that XML is schizophrenic: It tries to be "human-
> readable", but at the same time it's *really* intended only for programs
> to read and generate. So it's trying to appeal to two completely different
> targets, and the result is a bloated mess.

Yep.

I see a lot of arguments that it's unnecessary to have both attributes and 
nested CDATA. This argument, however, only comes from people who don't use 
XML for markup. CDATA is the prose in your document. Attributes aren't. It's 
pretty straightforward if you're using it for markup. If you're using it as 
a wrapper for SOAP, then it doesn't make sense to have both attributes and 
CDATA, but then it doesn't make sense to use XML to start with in that case.

>   And rather unnecessarily at that, IMO. If they had done it with similar
> principles to LaTeX, it would have been human-readable, human-writable and
> relatively compact, all at the same time. Sure, it would have made XML parsers
> more complicated, but that's what programs are for: To ease the burden of
> people.

Agreed. Or, if they wanted a data transfer language like for SOAP or 
whatever, use ASN.1. It's already standardized, easy to read, write, and 
verify, and has both human-readable and compact and time-efficient 
representations.

-- 
   Darren New, San Diego CA, USA (PST)
   Insanity is a small city on the western
   border of the State of Mind.


Post a reply to this message

From: Tim Attwood
Subject: Re: XML rant
Date: 21 Jun 2009 22:50:42
Message: <4a3ef182$1@news.povray.org>
>>   I never understood why the closing tag must be named. What's the point?
>
> A tiny increase in the ability to handle or at least detect malformed XML.

For example lets say you have a very large document, and you
typo and omit a closure. With a named closure you continue parsing
the document until you hit the next closure, and see that it doesn't
match, so you can exit early with an error. If you have unnamed
closures, then you continue parsing until the end of the file, (or the
top level tag), where you can then generate an error that says there
are more tags than closures, but then that error can't say for sure
which closure is missing, since unnamed closures are interchangable.

Personally I find flat tags clearer than forcing them into trees.


Post a reply to this message

From: Patrick Elliott
Subject: Re: XML rant
Date: 22 Jun 2009 00:06:43
Message: <4a3f0353$1@news.povray.org>
Warp wrote:
> Orchid XP v8 <voi### [at] devnull> wrote:
>> Warp wrote:
> 
>>>   I never understood why the closing tag must be named. What's the point?
> 
>> A tiny increase in the ability to handle or at least detect malformed XML.
> 
>   Why should a program be able to try to guess what a malformed XML file
> might be trying to say? There's no way of unambiguously tell what the
> properly-formatted version would have looked like.
> 
>   And if the XML file is malformed, it means that a person wrote it by hand.
> Wouldn't it be better to directly tell the person that there's a mistake in
> the file, rather than try to hide it, and possibly interpret it wrongly?
> 
Or.. It downloaded wrong (still does happen), got corrupted somehow, 
your application you wrote yourself isn't "writing" it out correctly, etc.

Would be different, I supposed, if they had made it like code, and the 
start tag was a "name", and everything else was between {}, or 
something, but..

-- 
void main () {

     if version = "Vista" {
       call slow_by_half();
       call DRM_everything();
     }
     call functional_code();
   }
   else
     call crash_windows();
}

<A HREF='http://www.daz3d.com/index.php?refid=16130551'>Get 3D Models, 
3D Content, and 3D Software at DAZ3D!</A>


Post a reply to this message

From: Invisible
Subject: Re: XML rant
Date: 22 Jun 2009 06:07:30
Message: <4a3f57e2@news.povray.org>
Darren New wrote:

> http://harmful.cat-v.org/software/xml/s-exp_vs_XML

...what the HELL?

Is this guy has I point, I don't know what it is. I must have missed it 
somewhere between the outbursts of delusional raving.

Seriously. XML is overcomplicated and so forth, and there are all mannar 
of technical complaints you could make about it, but I see very little 
technical material in this drivel.


Post a reply to this message

From: andrel
Subject: Re: XML rant
Date: 22 Jun 2009 10:46:58
Message: <4A3F9964.7000409@hotmail.com>
On 22-6-2009 4:50, Tim Attwood wrote:

> 
> Personally I find flat tags clearer than forcing them into trees.

Am I the only one to read that as 'flat tax'?


Post a reply to this message

From: Warp
Subject: Re: XML rant
Date: 22 Jun 2009 12:21:52
Message: <4a3fafa0@news.povray.org>
Patrick Elliott <sel### [at] npgcablecom> wrote:
> Or.. It downloaded wrong (still does happen), got corrupted somehow, 
> your application you wrote yourself isn't "writing" it out correctly, etc.

  Named end tags are certainly not in any way the best way of dealing
with those problems.

-- 
                                                          - Warp


Post a reply to this message

From: Orchid XP v8
Subject: Re: XML rant
Date: 22 Jun 2009 15:25:10
Message: <4a3fda96$1@news.povray.org>
Invisible wrote:

> Seriously. XML is overcomplicated and so forth, and there are all mannar 
> of technical complaints you could make about it

http://www.w3.org/TR/xqueryx/#Examples

That's pretty special, right there...

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Patrick Elliott
Subject: Re: XML rant
Date: 23 Jun 2009 18:22:48
Message: <4a4155b8$1@news.povray.org>
Warp wrote:
> Patrick Elliott <sel### [at] npgcablecom> wrote:
>> Or.. It downloaded wrong (still does happen), got corrupted somehow, 
>> your application you wrote yourself isn't "writing" it out correctly, etc.
> 
>   Named end tags are certainly not in any way the best way of dealing
> with those problems.
> 
If you plan to have a machine look it over, true. Its "supposed" to be 
sort of human readable though, and more conventional code type stuff, 
especially if you are tired, can be damn hard to "see" mistakes in some 
times. lol

-- 
void main () {

     if version = "Vista" {
       call slow_by_half();
       call DRM_everything();
     }
     call functional_code();
   }
   else
     call crash_windows();
}

<A HREF='http://www.daz3d.com/index.php?refid=16130551'>Get 3D Models, 
3D Content, and 3D Software at DAZ3D!</A>


Post a reply to this message

<<< Previous 5 Messages Goto Initial 10 Messages

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