Class ITER_CSSPath
java.lang.Object
fr.mines_stetienne.ci.sparql_generate.iterator.IteratorStreamFunctionBase
fr.mines_stetienne.ci.sparql_generate.iterator.IteratorFunctionBase
fr.mines_stetienne.ci.sparql_generate.xml.ITER_CSSPath
- All Implemented Interfaces:
fr.mines_stetienne.ci.sparql_generate.iterator.IteratorFunction
public class ITER_CSSPath
extends fr.mines_stetienne.ci.sparql_generate.iterator.IteratorFunctionBase
Iterator function
iter:CSSPath
extracts parts of a HTML document, using CSS-Selector-like queries.
See Live example
- Param 1: (html): the URI of the HTML document (a URI), or the HTML document itself (a String);
- Param 2: (cssSelector) is the CSS Selector. See https://jsoup.org/apidocs/org/jsoup/select/Selector.html for the base syntax specification.
- Param 3 .. N : (auxCssSelector ... ) other CSS Selectors, which will be executed over each of the results of the execution of xPath, exactly as if the binding function fun:CSSPath was applied. By default, the output is the outer HTML of the first matched element. However, two additions to the CSS Selector syntax can change this behaviour:
- (if the selector ends with
/text()
) the output is the combined text of the first matched element and all its children. Whitespaces are normalized and trimmed. - (if the selector ends with
@attributeName
) the output is the value of the attributeattributeName
for the first matched element.
- Output 1: (string) outer HTML of the matched element;
- Output 2 .. N-1: (string) result of the execution of the auxiliary CSS Selector queries on Output 1, encoded as literals;
- Output N: (integer) the position of the result in the list;
- Output N+1: (boolean) true if this result has a next result in the list.
-
Field Summary
-
Constructor Summary
-
Method Summary
Methods inherited from class fr.mines_stetienne.ci.sparql_generate.iterator.IteratorFunctionBase
exec
Methods inherited from class fr.mines_stetienne.ci.sparql_generate.iterator.IteratorStreamFunctionBase
build, exec, getContext
-
Field Details
-
URI
- See Also:
- Constant Field Values
-
-
Constructor Details
-
ITER_CSSPath
public ITER_CSSPath()
-
-
Method Details
-
exec
public List<List<org.apache.jena.sparql.expr.NodeValue>> exec(List<org.apache.jena.sparql.expr.NodeValue> args)- Specified by:
exec
in classfr.mines_stetienne.ci.sparql_generate.iterator.IteratorFunctionBase
-
checkBuild
public void checkBuild(org.apache.jena.sparql.expr.ExprList args)- Specified by:
checkBuild
in classfr.mines_stetienne.ci.sparql_generate.iterator.IteratorStreamFunctionBase
-