コード例 #1
0
PRBool
txXPathTreeWalker::moveToNextAttribute()
{
    // XXX an assertion should be enough here with the current code
    if (INNER->nodeType != Node::ATTRIBUTE_NODE) {
        return PR_FALSE;
    }

    Element* element = static_cast<Element*>(INNER->getXPathParent());
    Attr *attribute = element->getFirstAttribute();
    while (attribute != INNER) {
        attribute = attribute->getNextAttribute();
    }
    NS_ASSERTION(attribute, "Attr not attribute of it's owner?");

    attribute = attribute->getNextAttribute();

    while (attribute) {
        if (attribute->getNamespaceID() != kNameSpaceID_XMLNS) {
            INNER = attribute;

            return PR_TRUE;
        }

        attribute = attribute->getNextAttribute();
    }

    return PR_FALSE;
}
コード例 #2
0
PRBool
txXPathTreeWalker::moveToFirstAttribute()
{
    if (INNER->nodeType != Node::ELEMENT_NODE) {
        return PR_FALSE;
    }

    Element* element = static_cast<Element*>(INNER);
    Attr *attribute = element->getFirstAttribute();
    while (attribute) {
        if (attribute->getNamespaceID() != kNameSpaceID_XMLNS) {
            INNER = attribute;

            return PR_TRUE;
        }

        attribute = attribute->getNextAttribute();
    }

    return PR_FALSE;
}