Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions
txKey.h File Reference
#include "nsDoubleHashtable.h"
#include "txNodeSet.h"
#include "txList.h"
#include "txXSLTPatterns.h"
#include "XMLUtils.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  txKeyValueHashKey
struct  txKeyValueHashEntry
class  txIndexedKeyHashKey
struct  txIndexedKeyHashEntry
class  txKeyHash

Functions

 DECL_DHASH_WRAPPER (txIndexedKeyHash, txIndexedKeyHashEntry, txIndexedKeyHashKey &) class txXSLKey
 Class holding all <xsl:key>s of a particular expanded name in the stylesheet.

Function Documentation

DECL_DHASH_WRAPPER ( txIndexedKeyHash  ,
txIndexedKeyHashEntry  ,
txIndexedKeyHashKey  
)

Class holding all <xsl:key>s of a particular expanded name in the stylesheet.

Adds a match/use pair.

Parameters:
aMatchmatch-pattern
aUseuse-expression
Returns:
PR_FALSE if an error occured, PR_TRUE otherwise

Indexes a document and adds it to the hash of key values

Parameters:
aDocumentDocument to index and add
aKeyValueHashHash to add values to
aEstxExecutionState to use for XPath evaluation

Recursively searches a node, its attributes and its subtree for nodes matching any of the keys match-patterns.

Parameters:
aNodeNode to search
aKeyKey to use when adding into the hash
aKeyValueHashHash to add values to
aEstxExecutionState to use for XPath evaluation

Tests one node if it matches any of the keys match-patterns. If the node matches its values are added to the index.

Parameters:
aNodeNode to test
aKeyKey to use when adding into the hash
aKeyValueHashHash to add values to
aEstxExecutionState to use for XPath evaluation

represents one match/use pair

List of all match/use pairs. The items as |Key|s

Name of this key

Definition at line 119 of file txKey.h.

               : public TxObject {
    
public:
    txXSLKey(const txExpandedName& aName) : mName(aName)
    {
    }
    ~txXSLKey();
    
    PRBool addKey(nsAutoPtr<txPattern> aMatch, nsAutoPtr<Expr> aUse);

    nsresult indexDocument(const txXPathNode& aDocument,
                           txKeyValueHash& aKeyValueHash,
                           txExecutionState& aEs);

private:
    nsresult indexTree(const txXPathNode& aNode, txKeyValueHashKey& aKey,
                       txKeyValueHash& aKeyValueHash, txExecutionState& aEs);

    nsresult testNode(const txXPathNode& aNode, txKeyValueHashKey& aKey,
                      txKeyValueHash& aKeyValueHash, txExecutionState& aEs);

    struct Key {
        nsAutoPtr<txPattern> matchPattern;
        nsAutoPtr<Expr> useExpr;
    };

    List mKeys;
    
    txExpandedName mName;
};