#include "../config/pathan_config.h" /* * Copyright (c) 2001, DecisionSoft Limited All rights reserved. * Please see LICENSE.TXT for more information. */ #include #include #include NavStepImpl::Axis FollowingSiblingAxis::getAxis() const { return NavStepImpl::FOLLOWING_SIBLING; } Sequence FollowingSiblingAxis::makeList(const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *node, const XMLCh* const uri, DynamicContext* context) const { XPath2MemoryManager* memMgr=context->getMemoryManager(); Sequence returnList(memMgr); //If the node is an attribute node, then return an empty list if(node->getNodeType() == XERCES_CPP_NAMESPACE_QUALIFIER DOMNode::ATTRIBUTE_NODE) { return returnList; }//if //Return all the siblings of the given node XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *currentNode = node->getNextSibling(); while(currentNode != 0) { if(currentNode->getNodeType() == XERCES_CPP_NAMESPACE_QUALIFIER DOMNode::ENTITY_REFERENCE_NODE) { XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *child=currentNode->getFirstChild(); if(child) { if(filterNode(child,uri,context)) returnList.addItem(memMgr->createNode(child)); returnList.joinSequence(makeList(child,uri,context)); } } else if(filterNode(currentNode, uri, context)) returnList.addItem(memMgr->createNode(currentNode)); currentNode = currentNode->getNextSibling(); }//while return returnList; }//makeList