示例#1
0
void XMLTreeBuilder::processNamespaces(const AtomicXMLToken& token, NodeStackItem& stackItem)
{
    for (unsigned i = 0; i < token.attributes().size(); ++i) {
        const Attribute& tokenAttribute = token.attributes().at(i);
        if (tokenAttribute.name().prefix() == xmlnsAtom)
            stackItem.setNamespaceURI(tokenAttribute.name().localName(), tokenAttribute.value());
        else if (tokenAttribute.name() == xmlnsAtom)
            stackItem.setNamespaceURI(tokenAttribute.value());
    }
}
示例#2
0
void XMLTreeBuilder::processNamespaces(const AtomicXMLToken& token, NodeStackItem& stackItem)
{
    if (!token.attributes())
        return;

    for (size_t i = 0; i < token.attributes()->size(); ++i) {
        Attribute* attribute = token.attributes()->attributeItem(i);
        if (attribute->name().prefix() == xmlnsAtom)
            stackItem.setNamespaceURI(attribute->name().localName(), attribute->value());
        else if (attribute->name() == xmlnsAtom)
            stackItem.setNamespaceURI(attribute->value());
    }
}