ExtractionCursor ClassC# API
Stores details of an extraction from a Response.
Inheritance Hierarchy

System Object
  Facilita.Native ExtractionCursor

Namespace: Facilita.Native
Assembly: clrNativeWrapper (in clrNativeWrapper.dll) Version: (

public class ExtractionCursor : IDisposable

The current position in the page is stored, so an ExtractionCursor object can be re-used to find successive matches in a Response.

The following example demonstrates extracting multiple tokens from an XML response.

If it is necessary to extract the tokens from this response and store them in a List<string>, the following method could be written which makes use of the ExtractionCursor class.

public List<string> FindTokens(Response response)
    // Create a List to store the tokens
    List<string> tokens = new List<string>();

    // Use an ExtractionCursor to remember our current position within the Response
    ExtractionCursor cursor = new ExtractionCursor();

    // Loop until we can't find any more tokens      
        // Extract the next token 
        string token = response.Extract(cursor, "<token>", "</token>", ActionType.ACT_NONE);
        if (cursor.Succeeded)
            WriteMessage(String.Format("Found token {0} at position {1}", token, cursor.Index));
    while (cursor.Succeeded);
    return tokens;
See Also