OpenSimulator:Xml Serialization

From OpenSimulator

Revision as of 13:10, 23 January 2008 by Lbsa71 (Talk | contribs)

Jump to: navigation, search


Opensimulator Xml Serialization Format 3


  • Attributes and elements should map 1-to-1 with normalized object structure and hence protocol fields
  • Xml should be as terse as possible whilst generating intuitive results
  • The xml format should weigh human readability against the cost of parsing and re-calculation
  • The format should never introduce unintuitive constructs or cases
  • The implicit defaults should always reflect Second Life GUI defaults
  • Automatic Xml Serialization should never introduce explicit values that are identical to default values

Draft speculation

  • Since almost all fields have three distinct flavours ("SL GUI values", "LSL PrimitiveParams values" and "Protocol values") we should be able to specify values with units. The default unit should be "Protocol values".

What the unit monikers should be is up for anyone to suggest.

  Alternative 1:
  <Taper><X>200</X></Taper> means protocol value 200
  <Taper><X unit="pp">2.0</X></Taper> means LSL value 2.0
  <Taper><X unit="ui">-1.0</X></Taper> means SL gui value -1.0
  Alternative 2:
  <... taperX="200" ...> protocol 200
  <... taperX="2.0pp" ...> LSL 2.0
  <... taperX="-1.0ui" ...> GUI -1.0

The former is more verbose ('more XML'), the latter terser ('more HTML'). Please do add your opinion.

  • The fields that are enumerated should be encoded as either element types, attribute strings or attribute numbers. The default should be attribute numbers.
  <Object ...> means PCode 9 (Primitive)
  <Tree ...> means PCode x (Tree)
  <Avatar ...> means PCode z (Avatar)
  <... extrusion="straight" ...> means protocol value 0 (PathCurve.Straight)
  <... extrusion="1" ...> means protocol value 1 (

Node types

  • entity identifiers (LLUUID vs URI)
  • permissions
  • world, scene, avatar, object, part, shape
  • texture definitions


  • The Texture entry should be constructed in line with how the faces are enumerated on an object, ie: every face that is optional in a TextureEntry array, should be defined as an omissible element with one or several 'Face' nodes. If possible, this will make the Texture Face enumeration simpler.

For example, the 'hollow' will introduce faces only if hollow > 0. Hence, hollow chould be defined as

  <Hollow size="20%"><Face color="#ffdd33"><Texture src=""/></Face></Hollow>

as opposed to

  <... hollow="20%" ...>

thus allowing the parsing logic to encapsulate what exact faceId the texture should go into.

Personal tools
About This Wiki