OK I know (unfortunately) I've not been paying huge attention to recent VOS going ons but I would say that I'd be highly inclined to go down the XML route here. As you said, XML is pretty much the norm nowadays for describing any form of arbitrary data. Other reasons I can think of for going with XML are:
- XML can be validated (using XSD) and transformed (using XSLT), which could both prove to be useful for VOS in the future
- XML parsers exist for every platform out there from PDA to supercomputer!
- Syntax highlighting is built in to most editors (vi, notepad2, textpad, visual studio etc). Some of these can even link to the XSD file and can provide you real time validation as you type
- There are also lots of XML editors out there which can give you a graphical or collapsable view of your XML configuration file
- There are lots of other bolt-on technologies and standards related to to XML, such as XML signing, XML encryption and SOAP web services.
Regards
Neil
On 10/25/05, Peter Amstutz <[EMAIL PROTECTED]> wrote:
-BEGIN PGP SIGNED MESSAGE-Hash: SHA1On Tue, 25 Oct 2005, Lalo Martins wrote:> And so says Peter Amstutz on 10/24/05 01:29...
>> Alright, I've come around and decided that maybe an XML representation>> is the way to go. Here's a sample file that demonstrates how it might>> look:>> Yuck. Can I insist on YAML? :-P
>> It looks horrible, and I really don't think XML is the best choice for> *anything* that has to be written, read, and edited by humans.Ok then, for comparison's sake, here's how it might look in YAML:
Site:# Site consists of one or more root vobjects - Vobject: worldType: a3dl:sector# (optional) defines access control policy for this vobject and# all children that don't define their own access control policy
Acl: - Policy: core:accept-all,property:deny-all- Member: /phred- Member: /barneyChildren:# Shorthand for defining a child vobject property - Property: example
Datatype: text/plainData: Data goes here# Link to a vobject on a remote site - Link: bloxxTo: vip://interreality.org/bloxx
# Link to a vobject on the local site - Link: that-guyTo: /phred# Can also specify a child object and supply datablocks (so it is# loaded via the persistance interface) - Child: another-example
Type: property:propertyBlocks: - Name: property:dataData: Hello there - Name: property:datatypeData: text/plain# Child nodes are processed recursively the same way as vobject nodes
- Child: an-objectType: a3dl:object3d.cube- Property: a3dl:position Data: 1 2 3- Property: a3dl:orientation Data: 0 1 0 90- Child: a3dl:material
Type: a3dl:material - Property: a3dl:colorData: .3 .5 .7# Can define additional vobjects which are not connected to the# first vobject- Vobject: phred Type: core:identity,misc:avatar
- Vobject: barney Type: core:identity,misc:avatarNumber of lines in XML: 45Number of of lines in YAML: 53This represents a fairly literal translation of the proposed XML grammar
to a YAML grammar. There may be a better way to do it... Or it may bethat there are restrictions in the data model that I'm not seeing, whichwould require expanding the structure a bit more.Alright, my comments. First off, I'm not keen whitespace-sensitive
syntaxes in general. Python (for example) is nice and all, but in myexperience whitespace sensitivity just makes tasks like cutting andpasting blocks of code a huge pain in the ass, because it's impossible to
have the editor autoformat your code. Also, as you can see above, whenyou start inserting comments and empty lines, or a data block becomesparticularly large, it becomes increasingly hard to keep track of
indentation level. So I don't feel it is huge advantage in readabilityand editing that people make it out to be.My second issue is that it doesn't seem to directly support the notion ofa "associative array" which is at the heart of VOS. It has a sequence
type, and a mapping type, but no ordered, associative sequence type.This makes specifying heterogenous lists (such as the child list, whereeach entry can be an embedded object, a link, or a property) at best a bit
less elegant, at worst impossible (I haven't looked closely enough at theschema language yet).Third, it's not clear there is even a working C++ or C implementation of aYAML parser, and I don't intend to write my own.
Reasons I've come around to XML, despite not liking it initially:* Parts of VOS were deliberately based on XML DOM -- this is why HyperVOSworks so well. So mapping VOS into XML isn't that much of a stretch.
* Everybody and their dog knows XML and is already comfortable with thesyntax.* Rich toolset and library support for every language, OS and platform.* It's the magical XML pixie dust that makes everything more exciting!!!
I do agree