cascading.operation.xml
Class XPathParser
java.lang.Object
cascading.operation.BaseOperation<cascading.util.Pair<DocumentBuilder,cascading.tuple.Tuple>>
cascading.operation.xml.XPathOperation
cascading.operation.xml.XPathParser
- All Implemented Interfaces:
- cascading.flow.planner.DeclaresResults, cascading.operation.Function<cascading.util.Pair<DocumentBuilder,cascading.tuple.Tuple>>, cascading.operation.Operation<cascading.util.Pair<DocumentBuilder,cascading.tuple.Tuple>>, Serializable
public class XPathParser
- extends XPathOperation
- implements cascading.operation.Function<cascading.util.Pair<DocumentBuilder,cascading.tuple.Tuple>>
XPathParser will extract a value from the passed Tuple argument into a new Tuple field. One field
for every given XPath expression will be created. This function effectively converts an XML document into
a table.
If the returned value of the expression is a NodeList, only the first Node is used. The Node is converted to a new
XML document and converted to a String. If only the text values are required, search on the text() nodes, or consider
using XPathGenerator
to handle multiple NodeList values.
- See Also:
- Serialized Form
Fields inherited from class cascading.operation.BaseOperation |
fieldDeclaration, numArgs, trace |
Fields inherited from interface cascading.operation.Operation |
ANY |
Constructor Summary |
XPathParser(cascading.tuple.Fields fieldDeclaration,
String... paths)
Constructor XPathParser creates a new XPathParser instance. |
XPathParser(cascading.tuple.Fields fieldDeclaration,
String[][] namespaces,
String... paths)
Constructor XPathParser creates a new XPathParser instance. |
Method Summary |
void |
operate(cascading.flow.FlowProcess flowProcess,
cascading.operation.FunctionCall<cascading.util.Pair<DocumentBuilder,cascading.tuple.Tuple>> functionCall)
|
Methods inherited from class cascading.operation.BaseOperation |
cleanup, flush, getFieldDeclaration, getNumArgs, getTrace, isSafe, printOperationInternal, toString, toStringInternal |
Methods inherited from interface cascading.operation.Operation |
cleanup, flush, getFieldDeclaration, getNumArgs, isSafe, prepare |
XPathParser
public XPathParser(cascading.tuple.Fields fieldDeclaration,
String[][] namespaces,
String... paths)
- Constructor XPathParser creates a new XPathParser instance.
- Parameters:
fieldDeclaration
- of type Fieldsnamespaces
- of type String[][]paths
- of type String...
XPathParser
public XPathParser(cascading.tuple.Fields fieldDeclaration,
String... paths)
- Constructor XPathParser creates a new XPathParser instance.
- Parameters:
fieldDeclaration
- of type Fieldspaths
- of type String...
operate
public void operate(cascading.flow.FlowProcess flowProcess,
cascading.operation.FunctionCall<cascading.util.Pair<DocumentBuilder,cascading.tuple.Tuple>> functionCall)
- Specified by:
operate
in interface cascading.operation.Function<cascading.util.Pair<DocumentBuilder,cascading.tuple.Tuple>>
Copyright © 2007-2013 Concurrent, Inc. All Rights Reserved.