Class FUN_CSSPath
java.lang.Object
org.apache.jena.sparql.function.FunctionBase
org.apache.jena.sparql.function.FunctionBase2
fr.mines_stetienne.ci.sparql_generate.xml.FUN_CSSPath
- All Implemented Interfaces:
org.apache.jena.sparql.function.Function
public class FUN_CSSPath
extends org.apache.jena.sparql.function.FunctionBase2
Binding function
fun:CSSPath
evaluates a CSS Selector over a HTML document and can return (a) the outer
HTML, (b) the inner text, or (c) the value of an attribute.
The parameters are defined as follows
- Param 1: (html) is a literal that contains a HTML document;
- Param 2: (cssSelector) is the CSS Selector. See https://jsoup.org/apidocs/org/jsoup/select/Selector.html for the base syntax specification. 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. Whitespace is normalized and trimmed. - (if the selector ends with
@attributeName
) the output is the value of the attributeattributeName
for the first matched element.
-
Field Summary
-
Constructor Summary
-
Method Summary
Methods inherited from class org.apache.jena.sparql.function.FunctionBase2
checkBuild, exec
Methods inherited from class org.apache.jena.sparql.function.FunctionBase
build, evalArgs, exec
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.jena.sparql.function.Function
build
-
Field Details
-
URI
- See Also:
- Constant Field Values
-
-
Constructor Details
-
FUN_CSSPath
public FUN_CSSPath()
-
-
Method Details
-
exec
public org.apache.jena.sparql.expr.NodeValue exec(org.apache.jena.sparql.expr.NodeValue html, org.apache.jena.sparql.expr.NodeValue query)- Specified by:
exec
in classorg.apache.jena.sparql.function.FunctionBase2
-
select
public org.apache.jena.sparql.expr.NodeValue select(org.jsoup.nodes.Element htmldoc, String selectPath) throws org.apache.jena.sparql.expr.ExprEvalException- Throws:
org.apache.jena.sparql.expr.ExprEvalException
-