POV-Ray : Newsgroups : povray.programming : A Proposal for XML POV : Re: A Proposal for XML POV Server Time
29 Jul 2024 00:23:20 EDT (-0400)
  Re: A Proposal for XML POV  
From: Peter J  Holzer
Date: 1 Apr 2000 09:03:47
Message: <slrn8ebvfs.7j3.hjp-usenet@teal.h.hjp.at>
On Thu, 30 Mar 2000 21:39:58 -0500, pk wrote:
>[snip]
>What do you actually propose???
>that instead of declaring
>sphere{
>...}
>
>we do:
><primitive
> <sphere
>  Location="12,34,56"
>  <Texture
>   <checkered color1=1,.5,1 color2=1,.6,.4>
>   <transformation>
>    <rotate 10,0,0>
>   </tranformation>
>   >
>  >
> >

That's not XML. It would look more like

<sphere location="12,34,56" radius="1">
  <texture>
    <checker>
      <color rgb="1,.5,1" />
      <color rgb="1,.6,.4" />
    </checker>
    <rotate><x>10</x></rotate>
  </texture>
</sphere>

Note that the distinction between elements and attributes is pretty
arbitrary. When designing a DTD you would have to put some thought into
deciding whether it should be

<sphere location="12,34,56" radius="1" />

or 

<sphere>
  <location>
    <vector>
      <x> 12 </x>
      <y> 34 </y>
      <z> 56 </z>
    </vector>
  </location>
  <radius> 1 </radius>
</sphere>

or something in between.

>(which is pretty structured, compared to what i have seen in web
>pages)??

Most web pages aren't even syntactically correct (Try to point
http://validator.w3.org at some randomly chosen web pages), HTML allows
various shortcuts, and - most importantly - it is meant for marking up
text, not describing a data structure.

>BTW, i find that POV's syntax is easier to read

So do I.

>(and to parse, if you take the good way, probably)

Depends on what mean. A specially coded POV-Script parser is probably
faster at parsing a szene than an XML parser. But writing an XML parser
is easier, and you don't have to do it, because it already exists. (Of
course, at least two povscript parsers exist, too, so this may be a weak
argument).

>Definition language weren't made to support imbricked things/tags that
>work only in another tag

It does. In HTML, for example, a <title> element can only occur inside a
<head> element.

	hp

-- 

|_|_) | Sysadmin WSR     \ Durchbruch in der Bionik, und Microsoft geht
| |   | hjp### [at] wsracat     \ Pleite und Gardena bringt organische PC's
__/   | http://www.hjp.at/ \ auf den Markt.           -- Stefan Schaefer


Post a reply to this message

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