Description:

This processor evaluates one or more XQueries against the content of FlowFiles. The results of those XQueries are assigned to FlowFile attributes or are written to the content of the FlowFile itself, depending on how the user configures the Destination property in the processor. One attribute or FlowFile is produced for each XQuery result. Each produced FlowFile will carry the attributes of the input FlowFile. See the "Examples" section for details on how multiple results can be wrapped or concatenated. XQueries are entered by adding user-defined properties; the name of each user-added property maps to the attribute name into which the result should be placed. The value of the property must be a valid XQuery expression.

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. If a property has a default value, it is indicated. If a property supports the use of the NiFi Expression Language (or simply, "expression language"), that is also indicated.

Modifies Attributes:

This processor adds user-defined attributes if the <Destination> property is set to flowfile-attribute .

Relationships:

Examples:

This processor produces one attribute or FlowFile per XQueryResult. If only one attribute or FlowFile is desired, the following examples demonstrate how this can be achieved using the XQuery language. The examples below reference the following sample XML:


  <?xml version="1.0" encoding="UTF-8"?>
  <?xml-stylesheet type="text/xsl" href="foo.xsl"?>
  <ns:fruitbasket xmlns:ns="http://namespace/1">
    <fruit taste="crisp">    
      <!-- Apples are my favorite-->   
      <name>apple</name>   
      <color>red</color>  
    </fruit>  
    <fruit>   
      <name>apple</name>   
      <color>green</color>  
    </fruit>  
    <fruit>   
      <name>banana</name>   
      <color>yellow</color>  
    </fruit>  
    <fruit taste="sweet">   
      <name>orange</name>   
      <color>orange</color>  
    </fruit>  
    <fruit>   
      <name>blueberry</name>   
      <color>blue</color>  
    </fruit>  
      <fruit taste="tart">   
      <name>raspberry</name>   
      <color>red</color>  
    </fruit>  
    <fruit>   
      <name>none</name>    
      <color/>  
    </fruit>
  </ns:fruitbasket>