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>