Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
xml_script [2011/04/22 19:41]
hermann
xml_script [2013/07/30 23:59] (current)
admin [Reference]
Line 1: Line 1:
-====== ​XML Script ======+====== ​EGOML Script ======
  
 ===== Overview ===== ===== Overview =====
  
-Model can be saved as a XML document. The resulting file uses the extension "​.xml"​.+Any model can be saved as a EGOML document. The resulting file uses the extension "​.egoml"​((The old extension "​.xml" ​still supported for backward compatibility.)).
  
-Using the XML format ​is possible ​to write incomplete script having functors whose input and output ports are not completely bound. This allows saving models in the first development stages.+Below, it is an example of a EGOML script used to load a map, calculate an image convolution ​and save the result:
  
-The XML document is written according to the following DTD ((A good introduction to the DTD description syntax can be found at http://​skew.org/​xml/​tutorial.)):​ +<file xml apply-edge-detection-convolution.egoml>
- +
-<code dtd> +
-<?xml version="​1.0"?>​ +
-<​!DOCTYPE script [ +
-    <​!ELEMENT script (property*, functor*, containerfunctor*)>​ +
- +
-    <​!ELEMENT functor (property*, inputport*, outputport*)>​ +
-        <​!ATTLIST functor +
-            name   ​CDATA ​ #​REQUIRED>​ +
- +
-    <​!ELEMENT containerfunctor (property*, inputport*, outputport*,​ internalinputport*,​ internaloutputport*,​ functor*)>​ +
-        <​!ATTLIST containerfunctor +
-            name   ​CDATA ​ #​REQUIRED>​ +
- +
-    <​!ELEMENT property EMPTY> +
-        <​!ATTLIST property +
-            key    CDATA  #REQUIRED +
-            value  CDATA  #​REQUIRED>​ +
- +
-    <​!ELEMENT inputport (#​PCDATA)>​ +
-        <​!ATTLIST inputport +
-            name   ​CDATA ​ #REQUIRED +
-            peerid IDREFS #​IMPLIED>​ +
-    <​!ELEMENT outputport EMPTY> +
-        <​!ATTLIST outputport +
-            name   ​CDATA ​ #REQUIRED +
-            id     ​ID ​    #​REQUIRED>​ +
-     <​!ELEMENT internalinputport EMPTY> +
-        <​!ATTLIST internalinputport +
-            name   ​CDATA ​ #REQUIRED +
-            peerid IDREFS #​IMPLIED>​ +
-    <​!ELEMENT internaloutputport EMPTY> +
-        <​!ATTLIST internaloutputport +
-            name   ​CDATA ​ #REQUIRED +
-            id     ​ID ​    #​REQUIRED>​ +
-]> +
-</​code>​ +
- +
-The resulting document is not formated using tabs, spaces or newlines. Those characters are written only when they are inside the definition content, not in the content boundaries. +
- +
-Below it is an example of a XML script: +
- +
-<file xml apply-edge-detection-convolution.xml>+
 <?xml version="​1.0"​ standalone="​yes"​ ?>  <?xml version="​1.0"​ standalone="​yes"​ ?> 
 <​script>​ <​script>​
Line 102: Line 59:
 </​script>​ </​script>​
 </​file>​ </​file>​
 +
 +<note tip>
 +EGOML/XML format used to be the only format that could accept incomplete scripts, scripts having functors whose input and output ports are neither bound nor edited. However, since version 2.0, it is possible to save and load an incomplete [[EGO Script]] as well. This feature is useful to save models in the first development stages. ​
 +</​note>​
 +
 +===== Reference =====
 +
 +The EGOML file is a XML document written according to the following DTD ((A good introduction to the DTD description syntax can be found at http://​skew.org/​xml/​tutorial.)):​
 +
 +<code dtd>
 +<?xml version="​1.0"?>​
 +<​!DOCTYPE script [
 +  <​!ELEMENT script (property*, functor*, containerfunctor*)>​
 + 
 +  <​!ELEMENT functor (property*, inputport*, outputport*)>​
 +    <​!ATTLIST functor
 +      name   ​CDATA ​ #​REQUIRED>​
 + 
 +  <​!ELEMENT containerfunctor (property*, inputport*, outputport*,​ internalinputport*,​ internaloutputport*,​ functor*)>​
 +    <​!ATTLIST containerfunctor
 +      name   ​CDATA ​ #​REQUIRED>​
 + 
 +  <​!ELEMENT property EMPTY>
 +    <​!ATTLIST property
 +      key  CDATA  #REQUIRED
 +      value  CDATA  #​REQUIRED>​
 + 
 +  <​!ELEMENT inputport (#​PCDATA)>​
 +    <​!ATTLIST inputport
 +      name   ​CDATA ​ #REQUIRED
 +      peerid IDREFS #​IMPLIED>​
 +  <​!ELEMENT outputport EMPTY>
 +    <​!ATTLIST outputport
 +      name   ​CDATA ​ #REQUIRED
 +      id   ​ID ​  #​REQUIRED>​
 +   <​!ELEMENT internalinputport EMPTY>
 +    <​!ATTLIST internalinputport
 +      name   ​CDATA ​ #REQUIRED
 +      peerid IDREFS #​IMPLIED>​
 +  <​!ELEMENT internaloutputport EMPTY>
 +    <​!ATTLIST internaloutputport
 +      name   ​CDATA ​ #REQUIRED
 +      id   ​ID ​  #​REQUIRED>​
 +]>
 +</​code>​
 +
 +The property keys are always fully expanded. There is no property alias as in the [[EGO Script]] format.