Properties
DebugLogMode (from version 4.1)
Indicates the level of detail of debug information that is logged when running a Futurama application (website, webservice, console application) to the trace, a logfile, a database etc. The possible values are:
- None: no debug information is logged
- Simple: only basic information is given
- Extended: in addition to the information in the Simple mode the values of all the properties of the object are shown
IsPublic
Possible values are 'True' or 'False'. If the value is 'False', then the object can only be used within the document where it is created. If the value is 'True', then also from other Futurama documents can be referred to this object. This means that changes in the object also affect the document in which is referred to this object. If the value is 'True' and you attempt to move or delete the object, a warning will be given. To limit these warnings to a minimum it is recommended to set IsPublic to 'True' only when necessary.
Rank (from version 5.1)
Possible values are '0' or '1'. If the value is '1', then the XPath query returns a vector as a result, so that the XmlField holds a vector as its value. If the value is '0', then the XmlField will hold a single value (scalar).
XmlName
The name of the object as it is shown in the source of the website. By default the XmlName is equal to the name given in the property (Name) with spaces replaced by underscores, but you are free to change it.
(Name)
The name of the object.
Comment
Here a comment can be entered. For example a short description of the object.
ID
The unique identification number of the object. This number is automatically generated by Futurama on the moment of creation. This number can be used when searching for a certain object in the Find Window.
ReturnDefaultIfAbsent (from version 18.07)
If True, the XmlField will return a default value if the xpath result is empty (that is, no matching node is found). The default value will be 0, 0.0, “”, 1-1-1753 or false for datatype=long, double, string, date and boolean with rank 0. For rank 1, long[0], double[0], string[0], date[0] and bool[0] will be returned. If False, an error will be thrown.
ReturnDefaultIfEmpty (from version 18.07)
If True, the XmlField will return a default value if the xpath results in an empty node or empty nodes (for example or ). The default value will be 0, 0.0, “”, 1-1-1753 or false for datatype=long, double, string, date and boolean with rank 0. For rank 1, long[0], double[0], string[0], date[0] and bool[0] will be returned. If False, an error will be thrown.
XPath
Here you can enter an XPath 1.0 query. XPath is a query language for selecting nodes from an XML document. Here you can enter which data out of the XML of the XmlNode should be returned as the value of the XmlField.
Example
This example shows how the XmlNode and XmlField objects are used to import XML data into Futurama.
Download
Download the Futurama Document XMLNodeField Example.
Description
- Open the XML-document which is contained in the zip-file in the Futurama Editor (Version 4.2.1 or later).
- Here a n input Node can be seen that holds a Fixed of type String. In this Fixed an XML datafile is written as an example. Normally, you would read the XML data from an external file.
- The XmlNode 'Data' has the DataFile Fixed as its source. When you evaluate the node, you can see the content of the data in XML structure. Notice that a namespace has been declared in the NameSpaces property.
- The two XmlFields are used to derive the value of the input elements in the data. The first one is a double, the second one a date. Notice that the format of the date has been declared in the FormatInfo property.