blob: b9b4e67adcc41934333142f901866cbf621718f2 [file] [log] [blame]
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"></meta><title>ModifyHTMLElement</title><link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css"></link></head><script type="text/javascript">window.onload = function(){if(self==top) { document.getElementById('nameHeader').style.display = "inherit"; } }</script><body><h1 id="nameHeader" style="display: none;">ModifyHTMLElement</h1><h2>Description: </h2><p>Modifies the value of an existing HTML element. The desired element to be modified is located by using CSS selector syntax. The incoming HTML is first converted into a HTML Document Object Model so that HTML elements may be selected in the similar manner that CSS selectors are used to apply styles to HTML. The resulting HTML DOM is then "queried" using the user defined CSS selector string to find the element the user desires to modify. If the HTML element is found the element's value is updated in the DOM using the value specified "Modified Value" property. All DOM elements that match the CSS selector will be updated. Once all of the DOM elements have been updated the DOM is rendered to HTML and the result replaces the flowfile content with the updated HTML. A more thorough reference for the CSS selector syntax can be found at "http://jsoup.org/apidocs/org/jsoup/select/Selector.html"</p><h3>Tags: </h3><p>modify, html, dom, css, element</p><h3>Properties: </h3><p>In the list below, the names of required properties appear in <strong>bold</strong>. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the <a href="../../../../../html/expression-language-guide.html">NiFi Expression Language</a>.</p><table id="properties"><tr><th>Display Name</th><th>API Name</th><th>Default Value</th><th>Allowable Values</th><th>Description</th></tr><tr><td id="name"><strong>CSS Selector</strong></td><td>CSS Selector</td><td></td><td id="allowable-values"></td><td id="description">CSS selector syntax string used to extract the desired HTML element(s).<br/><strong>Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)</strong></td></tr><tr><td id="name"><strong>HTML Character Encoding</strong></td><td>HTML Character Encoding</td><td id="default-value">UTF-8</td><td id="allowable-values"></td><td id="description">Character encoding of the input HTML</td></tr><tr><td id="name"><strong>Output Type</strong></td><td>Output Type</td><td id="default-value">HTML</td><td id="allowable-values"><ul><li>HTML</li><li>Text</li><li>Attribute</li></ul></td><td id="description">Controls whether the HTML element is output as HTML,Text or Data</td></tr><tr><td id="name"><strong>Modified Value</strong></td><td>Modified Value</td><td></td><td id="allowable-values"></td><td id="description">Value to update the found HTML elements with<br/><strong>Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)</strong></td></tr><tr><td id="name">Attribute Name</td><td>Attribute Name</td><td></td><td id="allowable-values"></td><td id="description">When modifying the value of an element attribute this value is used as the key to determine which attribute on the selected element will be modified with the new value.<br/><strong>Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)</strong></td></tr></table><h3>Relationships: </h3><table id="relationships"><tr><th>Name</th><th>Description</th></tr><tr><td>element not found</td><td>Element could not be found in the HTML document. The original HTML input will remain in the FlowFile content unchanged. Relationship 'original' will not be invoked in this scenario.</td></tr><tr><td>success</td><td>Successfully parsed HTML element</td></tr><tr><td>original</td><td>The original HTML input</td></tr><tr><td>invalid html</td><td>The input HTML syntax is invalid</td></tr></table><h3>Reads Attributes: </h3>None specified.<h3>Writes Attributes: </h3><table id="writes-attributes"><tr><th>Name</th><th>Description</th></tr><tr><td>NumElementsModified</td><td>Total number of HTML element modifications made</td></tr></table><h3>State management: </h3>This component does not store state.<h3>Restricted: </h3>This component is not restricted.<h3>Input requirement: </h3>This component requires an incoming relationship.<h3>System Resource Considerations:</h3>None specified.<h3>See Also:</h3><p><a href="../org.apache.nifi.GetHTMLElement/index.html">GetHTMLElement</a>, <a href="../org.apache.nifi.PutHTMLElement/index.html">PutHTMLElement</a></p></body></html>