Marshal syntax

Data class Object provides the native method marshal. It returns a string representation of the receiver. The inverse functionality is implemented as method unmarshal in class String. The string representation of an object is in the xml format. And has the following rules:

  1. Each instance of an object in the dependency tree of the marshalled object has a unique identifier.
  2. In the root node, the id is given of represented object.
    	<poosl_marshal_data root="1">
    	
  3. Each object, primitive or non-primitive is a node in the XML tree.
    	<object id="1" class="CustomObject">
    		<assignments>
    			<assignment name="Aap" id="2"/>
    		</assignments>
    	</object>
    	
  4. Primitive objects and "String" can have a value:
    	<object id="2" class="String">
    		<value>aap</value>
    	</object>
    	
    This also applies to sub-classes from "String"
  5. The content of an array (or sub-class) is a list of assignments with '#m"' as id, where m is a positive Integer constant.
     
    	<object id="4" class="Array">
    		<assignments>
    			<assignment name="#1" id="3"/>
    			<assignment name="#2" id="6"/>
    		</assignments>
    	</object>
    	

An example of a marshalled object (CustomObject):

	<poosl_marshal_data root="1">
		<object id="1" class="CustomObject">
			<assignments>
				<assignment name="Aap" id="2"/>
				<assignment name="Noot" id="4"/>
			</assignments>
		</object>
		<object id="2" class="String">
			<value>aap</value>
		</object>
		<object id="5" class="Boolean">
			<value>true</value>
		</object>
		<object id="3" class="CustomString">
			<assignments>
				<assignment name="test" id="4"/>
			</assignments>
			<value>noot</value>
		</object>
		<object id="4" class="Array">
			<assignments>
				<assignment name="#1" id="3"/>
				<assignment name="#2" id="6"/>
				<assignment name="#3" id="5"/>
			</assignments>
		</object>
		<object id="6" class="Nil">
		</object>
	</poosl_marshal_data>