cascading.operation.xml

## Class XPathParser

- java.lang.Object
- - cascading.operation.BaseOperation<Pair<javax.xml.parsers.DocumentBuilder,Tuple>>
  - - cascading.operation.xml.XPathOperation
    - - cascading.operation.xml.XPathParser

- All Implemented Interfaces:
    DeclaresResults, Function<Pair<javax.xml.parsers.DocumentBuilder,Tuple>>, Operation<Pair<javax.xml.parsers.DocumentBuilder,Tuple>>, Traceable, java.io.Serializable

      public class XPathParser
      extends XPathOperation
      implements Function<Pair<javax.xml.parsers.DocumentBuilder,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

- - ### Field Summary

    - ### Fields inherited from class cascading.operation.xml.XPathOperation

      `NAMESPACE_XHTML, namespaces, paths`

    - ### Fields inherited from class cascading.operation.BaseOperation

      `fieldDeclaration, numArgs, trace`

    - ### Fields inherited from interface cascading.operation.Operation

      `ANY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XPathParser(Fields fieldDeclaration, java.lang.String... paths)` Constructor XPathParser creates a new XPathParser instance.
    `XPathParser(Fields fieldDeclaration, java.lang.String[][] namespaces, java.lang.String... paths)` Constructor XPathParser creates a new XPathParser instance.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `operate(FlowProcess flowProcess, FunctionCall<Pair<javax.xml.parsers.DocumentBuilder,Tuple>> functionCall)` Method operate provides the implementation of this Function.

    - ### Methods inherited from class cascading.operation.xml.XPathOperation

      `equals, getExpressions, getTransformer, getXPath, hashCode, parseDocument, prepare, writeAsXML`

    - ### Methods inherited from class cascading.operation.BaseOperation

      `cleanup, flush, getFieldDeclaration, getNumArgs, getTrace, isSafe, printOperationInternal, toString, toStringInternal`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface cascading.operation.Operation

      `cleanup, flush, getFieldDeclaration, getNumArgs, isSafe, prepare`

- - ### Constructor Detail

    - #### XPathParser

          public XPathParser(Fields fieldDeclaration,
                     java.lang.String[][] namespaces,
                     java.lang.String... paths)

      Constructor XPathParser creates a new XPathParser instance.
      Parameters:
        `fieldDeclaration` - of type Fields
        `namespaces` - of type String[][]
        `paths` - of type String...

    - #### XPathParser

          public XPathParser(Fields fieldDeclaration,
                     java.lang.String... paths)

      Constructor XPathParser creates a new XPathParser instance.
      Parameters:
        `fieldDeclaration` - of type Fields
        `paths` - of type String...

  - ### Method Detail

    - #### operate

          public void operate(FlowProcess flowProcess,
                     FunctionCall<Pair<javax.xml.parsers.DocumentBuilder,Tuple>> functionCall)

      Description copied from interface: `Function`
      Method operate provides the implementation of this Function.
      Specified by:
        `operate` in interface `Function<Pair<javax.xml.parsers.DocumentBuilder,Tuple>>`
      Parameters:
        `flowProcess` - of type FlowProcess
        `functionCall` - of type FunctionCall

Copyright © 2007-2015 Xplenty, Inc. All Rights Reserved.