Example #1
0
int32_t
txXSLTNumber::getSiblingCount(txXPathTreeWalker& aWalker,
                              txPattern* aCountPattern,
                              txIMatchContext* aContext)
{
    int32_t value = 1;
    while (aWalker.moveToPreviousSibling()) {
        if (aCountPattern->matches(aWalker.getCurrentPosition(), aContext)) {
            ++value;
        }
    }
    return value;
}
Example #2
0
nsresult LocationStep::appendIfMatching(const txXPathTreeWalker& aWalker,
                                        txIMatchContext* aContext,
                                        txNodeSet* aNodes) {
  bool matched;
  const txXPathNode& child = aWalker.getCurrentPosition();
  nsresult rv = mNodeTest->matches(child, aContext, matched);
  NS_ENSURE_SUCCESS(rv, rv);

  if (matched) {
    aNodes->append(child);
  }
  return NS_OK;
}