SubTree_PropValues

miscellaneous-functions SubTree_PropValues

syntax

  • SubTree_PropValues(item, property)
  • SubTree_PropValues(item, attribute)

definition

  • SubTree_PropValues(item, property) results in a new uint32 domain-unit with a string attribute containing the property values of the subitems of the item argument. The name of this attribute is the name of the property.
  • SubTree_PropValues(item, attribute) results in a new uint32 domain unit with a set of string attributes containing multiple property values of the subitems of the item argument. The names of the resulting attributes are the names of the properties.

applies to

  • argument item can be any tree item.
  • argument property needs to be a valid property name, the list of all properties can be found here.
  • argument attribute needs to a string data-item.

since version

7.103

example

1.
container PropValueSource
{
   parameter<string> label                     : ['ABC'];
   parameter<uint32> sumNrInhabitants (ADomain): [2,5,3,2,0];

   unit<uint32>  domainA: nrofrows = 9;
   unit<float64> valuesB:= baseunit('b',float64);
   container sublevel
   {
      attribute<uint32> meanNrInhabitants(PropValueSource): [1,2,1,1,0];
   }
}

unit<uint32> name := SubTree_PropValues(PropValueSource,'name');
unit<uint32> expr := SubTree_PropValues(PropValueSource,'Expr');
2.

unit<uint32> property : nrofrows = 2
{
   parameter<string> name: ['name','expr'];
}

unit<uint32> name_and_expr := SubTree_PropValues(PropValueSource, property/name);
name
label
sumNrInhabitants
domainA
valuesB
sublevel
meanNrInhabitants

domain name, nr of rows = 6

expr
 
 
 
baseunit(‘b’,float64)
 
 

domain expr, nr of rows = 6

name expr
label  
sumNrInhabitants  
domainA  
valuesB baseunit(‘b’,float64)
sublevel  
meanNrInhabitants  

domain name_and_expr, nr of rows = 6

see also