OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Peter Kelly (pmk@post.com) | 2 * Copyright (C) 2000 Peter Kelly (pmk@post.com) |
3 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. |
4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
5 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) | 5 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) |
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
7 * Copyright (C) 2008 Holger Hans Peter Freyther | 7 * Copyright (C) 2008 Holger Hans Peter Freyther |
8 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 break; | 800 break; |
801 parentElement = toElement(n); | 801 parentElement = toElement(n); |
802 } | 802 } |
803 | 803 |
804 if (elemStack.isEmpty()) | 804 if (elemStack.isEmpty()) |
805 return; | 805 return; |
806 | 806 |
807 for (; !elemStack.isEmpty(); elemStack.removeLast()) { | 807 for (; !elemStack.isEmpty(); elemStack.removeLast()) { |
808 Element* element = elemStack.last(); | 808 Element* element = elemStack.last(); |
809 if (element->hasAttributes()) { | 809 if (element->hasAttributes()) { |
810 AttributeIteratorAccessor attributes = element->attributesIterator()
; | 810 AttributeCollection attributes = element->attributes(); |
811 AttributeConstIterator end = attributes.end(); | 811 AttributeCollection::const_iterator end = attributes.end(); |
812 for (AttributeConstIterator it = attributes.begin(); it != end; ++it
) { | 812 for (AttributeCollection::const_iterator it = attributes.begin(); it
!= end; ++it) { |
813 if (it->localName() == xmlnsAtom) | 813 if (it->localName() == xmlnsAtom) |
814 m_defaultNamespaceURI = it->value(); | 814 m_defaultNamespaceURI = it->value(); |
815 else if (it->prefix() == xmlnsAtom) | 815 else if (it->prefix() == xmlnsAtom) |
816 m_prefixToNamespaceMap.set(it->localName(), it->value()); | 816 m_prefixToNamespaceMap.set(it->localName(), it->value()); |
817 } | 817 } |
818 } | 818 } |
819 } | 819 } |
820 | 820 |
821 // If the parent element is not in document tree, there may be no xmlns attr
ibute; just default to the parent's namespace. | 821 // If the parent element is not in document tree, there may be no xmlns attr
ibute; just default to the parent's namespace. |
822 if (m_defaultNamespaceURI.isNull() && !parentElement->inDocument()) | 822 if (m_defaultNamespaceURI.isNull() && !parentElement->inDocument()) |
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1616 sax.initialized = XML_SAX2_MAGIC; | 1616 sax.initialized = XML_SAX2_MAGIC; |
1617 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); | 1617 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); |
1618 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; | 1618 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; |
1619 parseChunk(parser->context(), parseString); | 1619 parseChunk(parser->context(), parseString); |
1620 finishParsing(parser->context()); | 1620 finishParsing(parser->context()); |
1621 attrsOK = state.gotAttributes; | 1621 attrsOK = state.gotAttributes; |
1622 return state.attributes; | 1622 return state.attributes; |
1623 } | 1623 } |
1624 | 1624 |
1625 } // namespace WebCore | 1625 } // namespace WebCore |
OLD | NEW |