Exemplo n.º 1
0
bool
txXSLTNumber::getPrevInDocumentOrder(txXPathTreeWalker& aWalker)
{
    if (aWalker.moveToPreviousSibling()) {
        while (aWalker.moveToLastChild()) {
            // do nothing
        }
        return true;
    }
    return aWalker.moveToParent();
}
Exemplo n.º 2
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;
}
Exemplo n.º 3
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;
}