diff --git a/examples/DOM/DOMWriter.cpp b/examples/DOM/DOMWriter.cpp index ec31400a..6dddaf52 100644 --- a/examples/DOM/DOMWriter.cpp +++ b/examples/DOM/DOMWriter.cpp @@ -20,7 +20,7 @@ int main(int argc, char* argv[]) } // if(argc < 2) { // narrow - SAX2DOM::Parser domParser; + Arabica::SAX2DOM::Parser domParser; Arabica::SAX::CatchErrorHandler eh; domParser.setErrorHandler(eh); @@ -42,7 +42,7 @@ int main(int argc, char* argv[]) if(!eh.errorsReported()) { - DOM::Document doc = domParser.getDocument(); + Arabica::DOM::Document doc = domParser.getDocument(); doc.normalize(); std::cout << doc; } @@ -57,7 +57,7 @@ int main(int argc, char* argv[]) /* { // wide - SAX2DOM::Parser domParser; + SAX2Arabica::DOM::Parser domParser; Arabica::SAX::wInputSource is; is.setSystemId(L"stdin"); @@ -65,7 +65,7 @@ int main(int argc, char* argv[]) domParser.parse(is); - DOM::Document doc = domParser.getDocument(); + Arabica::DOM::Document doc = domParser.getDocument(); std::wcout << doc; } diff --git a/examples/XPath/xgrep.cpp b/examples/XPath/xgrep.cpp index eab351b3..11decd2a 100644 --- a/examples/XPath/xgrep.cpp +++ b/examples/XPath/xgrep.cpp @@ -32,7 +32,7 @@ int main(int argc, char* argv[]) } - SAX2DOM::Parser domParser; + Arabica::SAX2DOM::Parser domParser; Arabica::SAX::CatchErrorHandler eh; domParser.setErrorHandler(eh); @@ -54,7 +54,7 @@ int main(int argc, char* argv[]) if(!eh.errorsReported()) { - DOM::Document doc = domParser.getDocument(); + Arabica::DOM::Document doc = domParser.getDocument(); // doc.normalize(); Arabica::XPath::XPathValuePtr result; result = xpath->evaluate(doc); @@ -66,7 +66,7 @@ int main(int argc, char* argv[]) const Arabica::XPath::NodeSet& ns = result->asNodeSet(); for(unsigned int i = 0; i < ns.size(); ++i) { - DOM::Node n = ns[i]; + Arabica::DOM::Node n = ns[i]; std::cout << n << std::endl; } } // if .. diff --git a/examples/XSLT/mangle.cpp b/examples/XSLT/mangle.cpp index 3d861bd2..24131456 100755 --- a/examples/XSLT/mangle.cpp +++ b/examples/XSLT/mangle.cpp @@ -10,7 +10,7 @@ #include void test_suite(int argc, const char* argv[]); -DOM::Document buildDOM(const std::string& xml); +Arabica::DOM::Document buildDOM(const std::string& xml); int main(int argc, const char* argv[]) { @@ -43,7 +43,7 @@ int main(int argc, const char* argv[]) stylesheet->set_error_output(errors); - DOM::Document document = buildDOM(argv[1]); + Arabica::DOM::Document document = buildDOM(argv[1]); if(document == 0) { std::cerr << "Could not parse XML source" << std::endl; @@ -62,10 +62,10 @@ int main(int argc, const char* argv[]) return 0; } // main -DOM::Document buildDOM(const std::string& filename) +Arabica::DOM::Document buildDOM(const std::string& filename) { Arabica::SAX::InputSource is(filename); - SAX2DOM::Parser parser; + Arabica::SAX2DOM::Parser parser; parser.parse(is); return parser.getDocument(); diff --git a/include/DOM/Attr.hpp b/include/DOM/Attr.hpp index dfd026eb..89256451 100644 --- a/include/DOM/Attr.hpp +++ b/include/DOM/Attr.hpp @@ -9,6 +9,8 @@ #include +namespace Arabica +{ namespace DOM { @@ -68,5 +70,6 @@ class Attr_impl : virtual public Node_impl }; // class Attr_impl } // namespace DOM +} // namespace Arabica #endif diff --git a/include/DOM/CDATASection.hpp b/include/DOM/CDATASection.hpp index 4deeb507..9f7debed 100644 --- a/include/DOM/CDATASection.hpp +++ b/include/DOM/CDATASection.hpp @@ -9,6 +9,8 @@ #include +namespace Arabica +{ namespace DOM { template class CDATASection_impl; @@ -43,7 +45,7 @@ class CDATASection_impl : public virtual Text_impl virtual ~CDATASection_impl() { } }; // CDATASection_impl - } // namespace DOM +} // namespace Arabica #endif diff --git a/include/DOM/CharacterData.hpp b/include/DOM/CharacterData.hpp index 4a7e3141..82d99653 100644 --- a/include/DOM/CharacterData.hpp +++ b/include/DOM/CharacterData.hpp @@ -9,6 +9,8 @@ #include +namespace Arabica +{ namespace DOM { template class CharacterData_impl; @@ -86,7 +88,7 @@ class CharacterData_impl : virtual public Node_impl virtual void replaceData(int offset, int count, const stringT& arg) = 0; }; // CharacterData_impl - } // namespace DOM +} // namespace Arabica #endif diff --git a/include/DOM/Comment.hpp b/include/DOM/Comment.hpp index 4a11113b..db7316af 100644 --- a/include/DOM/Comment.hpp +++ b/include/DOM/Comment.hpp @@ -9,6 +9,8 @@ #include +namespace Arabica +{ namespace DOM { template class Comment_impl; @@ -35,7 +37,7 @@ class Comment_impl : virtual public CharacterData_impl virtual ~Comment_impl() { } }; // Comment_impl - } // namespace DOM +} // namespace Arabica #endif diff --git a/include/DOM/DOMException.hpp b/include/DOM/DOMException.hpp index 14d34cbc..0281c59f 100644 --- a/include/DOM/DOMException.hpp +++ b/include/DOM/DOMException.hpp @@ -9,6 +9,8 @@ #include +namespace Arabica +{ namespace DOM { @@ -82,6 +84,7 @@ private: }; // class DOMException } // namespace DOM +} // namespace Arabica #endif diff --git a/include/DOM/DOMImplementation.hpp b/include/DOM/DOMImplementation.hpp index 4c210d37..3ec91ac5 100644 --- a/include/DOM/DOMImplementation.hpp +++ b/include/DOM/DOMImplementation.hpp @@ -9,6 +9,8 @@ #include +namespace Arabica +{ namespace DOM { @@ -92,6 +94,7 @@ class DOMImplementation_impl }; // class DOMImplementation_impl } // namespace DOM +} // namespace Arabica #endif // JEZUK_DOM_NODE_H // end of file diff --git a/include/DOM/Document.hpp b/include/DOM/Document.hpp index e2faa862..dcf30415 100644 --- a/include/DOM/Document.hpp +++ b/include/DOM/Document.hpp @@ -24,6 +24,8 @@ #include #include +namespace Arabica +{ namespace DOM { @@ -171,6 +173,7 @@ class Document_impl : virtual public Node_impl }; // class Document_impl } // namespace DOM +} // namespace Arabica #endif diff --git a/include/DOM/DocumentFragment.hpp b/include/DOM/DocumentFragment.hpp index ff737c77..4e75b1bb 100644 --- a/include/DOM/DocumentFragment.hpp +++ b/include/DOM/DocumentFragment.hpp @@ -10,6 +10,8 @@ #include #include +namespace Arabica +{ namespace DOM { @@ -38,6 +40,7 @@ class DocumentFragment_impl : virtual public Node_impl }; // class DocumentFragment_impl } // namespace DOM +} // namespace Arabica #endif diff --git a/include/DOM/DocumentType.hpp b/include/DOM/DocumentType.hpp index 76fe3a95..216c963c 100644 --- a/include/DOM/DocumentType.hpp +++ b/include/DOM/DocumentType.hpp @@ -11,6 +11,8 @@ #include #include +namespace Arabica +{ namespace DOM { @@ -73,6 +75,7 @@ class DocumentType_impl : virtual public Node_impl }; // class DocumentType_impl } // namespace DOM +} // namespace Arabica #endif diff --git a/include/DOM/DualMode/DualMode.hpp b/include/DOM/DualMode/DualMode.hpp index 73c3fcd8..b7fb1412 100644 --- a/include/DOM/DualMode/DualMode.hpp +++ b/include/DOM/DualMode/DualMode.hpp @@ -4,16 +4,18 @@ #include #include +namespace Arabica +{ namespace DualMode { template, class SAX_parser = Arabica::SAX::XMLReader > -class Parser : public SAX2DOM::Parser +class Parser : public Arabica::SAX2DOM::Parser { - typedef SAX2DOM::Parser BaseT; + typedef Arabica::SAX2DOM::Parser BaseT; public: - typedef boost::function2 &, DOM::Node &> ElementHandlerT; + typedef boost::function2 &, Arabica::DOM::Node &> ElementHandlerT; void setElementEndHandler(ElementHandlerT func) { @@ -27,7 +29,7 @@ class Parser : public SAX2DOM::Parser if(BaseT::currentNode() == 0) return; - DOM::Node child(BaseT::currentNode()); + Arabica::DOM::Node child(BaseT::currentNode()); BaseT::endElement(namespaceURI, localName, qName); @@ -40,5 +42,6 @@ class Parser : public SAX2DOM::Parser }; // class Parser } // namespace DualMode +} // namespace Arabica #endif diff --git a/include/DOM/Element.hpp b/include/DOM/Element.hpp index 021a943b..844439af 100644 --- a/include/DOM/Element.hpp +++ b/include/DOM/Element.hpp @@ -11,6 +11,8 @@ #include #include +namespace Arabica +{ namespace DOM { @@ -97,6 +99,6 @@ class Element_impl : virtual public Node_impl }; // class Element_impl } // namespace DOM - +} // namespace Arabica #endif // end of file diff --git a/include/DOM/Entity.hpp b/include/DOM/Entity.hpp index fee57e8e..40684ec9 100644 --- a/include/DOM/Entity.hpp +++ b/include/DOM/Entity.hpp @@ -9,6 +9,8 @@ #include +namespace Arabica +{ namespace DOM { @@ -57,6 +59,6 @@ class Entity_impl : virtual public Node_impl }; // class Entity_impl } // namespace DOM - +} // namespace Arabica #endif diff --git a/include/DOM/EntityReference.hpp b/include/DOM/EntityReference.hpp index 540c2f3b..6e9807a1 100644 --- a/include/DOM/EntityReference.hpp +++ b/include/DOM/EntityReference.hpp @@ -9,6 +9,8 @@ #include +namespace Arabica +{ namespace DOM { template class EntityReference_impl; @@ -35,8 +37,8 @@ class EntityReference_impl : virtual public Node_impl virtual ~EntityReference_impl () { } }; // EntityReference_impl - } // namespace DOM +} // namespace Arabica #endif diff --git a/include/DOM/Events/DocumentEvent.hpp b/include/DOM/Events/DocumentEvent.hpp index 023de4ac..de7083c9 100644 --- a/include/DOM/Events/DocumentEvent.hpp +++ b/include/DOM/Events/DocumentEvent.hpp @@ -9,6 +9,8 @@ #include +namespace Arabica +{ namespace DOM { @@ -68,6 +70,7 @@ class DocumentEvent_impl : virtual public DOM::Impl } // namespace Events } // namespace DOM +} // namespace Arabica #endif // end of file diff --git a/include/DOM/Events/Event.hpp b/include/DOM/Events/Event.hpp index 8fc08d8b..16982b97 100644 --- a/include/DOM/Events/Event.hpp +++ b/include/DOM/Events/Event.hpp @@ -1,6 +1,8 @@ #ifndef JEZUK_EVENTS_EVENT_H #define JEZUK_EVENTS_EVENT_H +namespace Arabica +{ namespace DOM { @@ -96,6 +98,7 @@ class Event_impl : virtual public Impl } // namespace Events } // namespace DOM +} // namespace Arabica #endif -// end of file \ No newline at end of file +// end of file diff --git a/include/DOM/Events/EventException.hpp b/include/DOM/Events/EventException.hpp index fb0e8b05..8fcc1677 100644 --- a/include/DOM/Events/EventException.hpp +++ b/include/DOM/Events/EventException.hpp @@ -9,6 +9,8 @@ #include +namespace Arabica +{ namespace DOM { @@ -29,5 +31,6 @@ public: } // namespace Events } // namespace DOM +} // namespace Arabica -#endif \ No newline at end of file +#endif diff --git a/include/DOM/Events/EventListener.hpp b/include/DOM/Events/EventListener.hpp index ccbc7293..d104806e 100644 --- a/include/DOM/Events/EventListener.hpp +++ b/include/DOM/Events/EventListener.hpp @@ -6,6 +6,8 @@ // $Id$ //////////////////////////// +namespace Arabica +{ namespace DOM { @@ -27,5 +29,6 @@ protected: } // namespace Events } // namespace DOM +} // namespace Arabica -#endif \ No newline at end of file +#endif diff --git a/include/DOM/Events/EventTarget.hpp b/include/DOM/Events/EventTarget.hpp index 7b3f6a27..8052e701 100644 --- a/include/DOM/Events/EventTarget.hpp +++ b/include/DOM/Events/EventTarget.hpp @@ -9,6 +9,8 @@ #include +namespace Arabica +{ namespace DOM { @@ -89,5 +91,6 @@ class EventTarget_impl : virtual public Impl } // namespace Events } // namespace DOM +} // namespace Arabica #endif diff --git a/include/DOM/Events/MutationEvent.hpp b/include/DOM/Events/MutationEvent.hpp index 85e9967d..e27d4a95 100644 --- a/include/DOM/Events/MutationEvent.hpp +++ b/include/DOM/Events/MutationEvent.hpp @@ -3,6 +3,8 @@ #include +namespace Arabica +{ namespace DOM { @@ -102,6 +104,7 @@ class MutationEvent_impl : virtual public Event_impl } // namespace Events } // namespace DOM +} // namespace Arabica #endif // end of file diff --git a/include/DOM/NamedNodeMap.hpp b/include/DOM/NamedNodeMap.hpp index 23f6c6e0..f48edb42 100644 --- a/include/DOM/NamedNodeMap.hpp +++ b/include/DOM/NamedNodeMap.hpp @@ -9,6 +9,8 @@ #include +namespace Arabica +{ namespace DOM { @@ -92,6 +94,7 @@ class NamedNodeMap_impl }; // class NamedNodeMap_impl } // namespace DOM +} // namespace Arabica #endif diff --git a/include/DOM/Node.hpp b/include/DOM/Node.hpp index 1005c65f..79667806 100644 --- a/include/DOM/Node.hpp +++ b/include/DOM/Node.hpp @@ -11,6 +11,8 @@ #include #include +namespace Arabica +{ namespace DOM { @@ -216,6 +218,7 @@ class Node_impl }; // class Node_impl } // namespace DOM +} // namespace Arabica #endif // JEZUK_DOM_NODE_H // end of file diff --git a/include/DOM/NodeList.hpp b/include/DOM/NodeList.hpp index 0bfcf5a9..43caefb6 100644 --- a/include/DOM/NodeList.hpp +++ b/include/DOM/NodeList.hpp @@ -9,6 +9,8 @@ #include +namespace Arabica +{ namespace DOM { @@ -63,6 +65,7 @@ class NodeList_impl }; // class NodeList_impl } // namespace DOM +} // namespace Arabica #endif diff --git a/include/DOM/Notation.hpp b/include/DOM/Notation.hpp index cccac680..3e7d9127 100644 --- a/include/DOM/Notation.hpp +++ b/include/DOM/Notation.hpp @@ -10,6 +10,8 @@ #include #include +namespace Arabica +{ namespace DOM { @@ -54,6 +56,7 @@ class Notation_impl : virtual public Node_impl }; // class Notation_impl } // namespace DOM +} // namespace Arabica #endif diff --git a/include/DOM/ProcessingInstruction.hpp b/include/DOM/ProcessingInstruction.hpp index e3f23997..9393ebe6 100644 --- a/include/DOM/ProcessingInstruction.hpp +++ b/include/DOM/ProcessingInstruction.hpp @@ -9,6 +9,8 @@ #include +namespace Arabica +{ namespace DOM { @@ -54,6 +56,6 @@ class ProcessingInstruction_impl : virtual public Node_impl }; // class ProcessingInstruction_impl } // namespace DOM - +} // namespace Arabica #endif diff --git a/include/DOM/Proxy.hpp b/include/DOM/Proxy.hpp index 083c01d0..44a3636c 100644 --- a/include/DOM/Proxy.hpp +++ b/include/DOM/Proxy.hpp @@ -1,6 +1,8 @@ #ifndef JEZUK_DOM_PROXY_H #define JEZUK_DOM_PROXY_H +namespace Arabica +{ namespace DOM { @@ -67,6 +69,7 @@ class Proxy }; // class Proxy } // namespace DOM +} // namespace Arabica #endif diff --git a/include/DOM/SAX2DOM/DocumentTypeImpl.hpp b/include/DOM/SAX2DOM/DocumentTypeImpl.hpp index 4d55185c..f6835a63 100644 --- a/include/DOM/SAX2DOM/DocumentTypeImpl.hpp +++ b/include/DOM/SAX2DOM/DocumentTypeImpl.hpp @@ -3,13 +3,15 @@ #include +namespace Arabica +{ namespace SAX2DOM { template -class DocumentType : public SimpleDOM::DocumentTypeImpl +class DocumentType : public Arabica::SimpleDOM::DocumentTypeImpl { - typedef SimpleDOM::DocumentTypeImpl BaseDT; + typedef Arabica::SimpleDOM::DocumentTypeImpl BaseDT; public: DocumentType(const stringT& qualifiedName, const stringT& publicId, @@ -22,30 +24,30 @@ class DocumentType : public SimpleDOM::DocumentTypeImpl* entity) + void addEntity(Arabica::SimpleDOM::EntityImpl* entity) { BaseDT::addEntity(entity); } // addEntity - void addNotation(SimpleDOM::NotationImpl* notation) + void addNotation(Arabica::SimpleDOM::NotationImpl* notation) { BaseDT::addNotation(notation); } // addNotation void addElement(const stringT& name) { - BaseDT::addElement(new SimpleDOM::ElementImpl(BaseDT::ownerDoc_, name)); + BaseDT::addElement(new Arabica::SimpleDOM::ElementImpl(BaseDT::ownerDoc_, name)); } // addElement void addDefaultAttr(const stringT& elementName, const stringT& attributeName, const stringT& attributeValue) { - SimpleDOM::ElementImpl* elem = dynamic_cast*>(BaseDT::getElements()->getNamedItem(elementName)); + Arabica::SimpleDOM::ElementImpl* elem = dynamic_cast*>(BaseDT::getElements()->getNamedItem(elementName)); if(elem == 0) { addElement(elementName); - elem = dynamic_cast*>(BaseDT::getElements()->getNamedItem(elementName)); + elem = dynamic_cast*>(BaseDT::getElements()->getNamedItem(elementName)); } - SimpleDOM::AttrImpl* attr = new SimpleDOM::AttrImpl(BaseDT::ownerDoc_, attributeName); + Arabica::SimpleDOM::AttrImpl* attr = new Arabica::SimpleDOM::AttrImpl(BaseDT::ownerDoc_, attributeName); attr->setValue(attributeValue); attr->setSpecified(false); elem->setAttributeNode(attr); @@ -58,6 +60,7 @@ class DocumentType : public SimpleDOM::DocumentTypeImpl #include +namespace Arabica +{ namespace SAX2DOM { @@ -28,9 +30,9 @@ class Parser : protected Arabica::SAX::basic_DefaultHandler typedef Arabica::SAX::basic_LexicalHandler LexicalHandlerT; typedef Arabica::SAX::basic_DeclHandler DeclHandlerT; typedef Arabica::SAX::basic_InputSource InputSourceT; - typedef SimpleDOM::EntityImpl EntityT; - typedef SimpleDOM::NotationImpl NotationT; - typedef SimpleDOM::ElementImpl ElementT; + typedef Arabica::SimpleDOM::EntityImpl EntityT; + typedef Arabica::SimpleDOM::NotationImpl NotationT; + typedef Arabica::SimpleDOM::ElementImpl ElementT; typedef typename Arabica::SAX::basic_ErrorHandler::SAXParseExceptionT SAXParseExceptionT; public: @@ -78,7 +80,7 @@ class Parser : protected Arabica::SAX::basic_DefaultHandler { Arabica::SAX::PropertyNames pNames; - DOM::DOMImplementation di = SimpleDOM::DOMImplementation::getDOMImplementation(); + DOM::DOMImplementation di = Arabica::SimpleDOM::DOMImplementation::getDOMImplementation(); document_ = di.createDocument(string_adaptorT::construct_from_utf8(""), string_adaptorT::construct_from_utf8(""), 0); currentNode_ = document_; inCDATA_ = false; @@ -391,7 +393,8 @@ class Parser : protected Arabica::SAX::basic_DefaultHandler } // unparsedEntityDecl }; // class Parser -} // namespace +} // namespace SAX2DOM +} // namespace Arabica #endif diff --git a/include/DOM/Simple/AttrImpl.hpp b/include/DOM/Simple/AttrImpl.hpp index e303a73d..3d40d91d 100644 --- a/include/DOM/Simple/AttrImpl.hpp +++ b/include/DOM/Simple/AttrImpl.hpp @@ -6,6 +6,8 @@ #include #include +namespace Arabica +{ namespace SimpleDOM { @@ -152,5 +154,6 @@ class AttrImpl : public DOM::Attr_impl, }; // class CDATAImpl } // namespace SimpleDOM +} // namespace Arabica #endif diff --git a/include/DOM/Simple/AttrMap.hpp b/include/DOM/Simple/AttrMap.hpp index b24dfea1..836bddca 100644 --- a/include/DOM/Simple/AttrMap.hpp +++ b/include/DOM/Simple/AttrMap.hpp @@ -5,6 +5,8 @@ #include #include +namespace Arabica +{ namespace SimpleDOM { @@ -176,6 +178,7 @@ class AttrMap : public NamedNodeMapImpl } // namespace SAX2DOM +} // namespace Arabica #endif diff --git a/include/DOM/Simple/AttrNSImpl.hpp b/include/DOM/Simple/AttrNSImpl.hpp index e55e2bd6..898202da 100644 --- a/include/DOM/Simple/AttrNSImpl.hpp +++ b/include/DOM/Simple/AttrNSImpl.hpp @@ -4,6 +4,8 @@ #include #include +namespace Arabica +{ namespace SimpleDOM { @@ -122,8 +124,8 @@ class AttrNSImpl : public AttrImpl bool hasNamespaceURI_; }; // class AttrNSImpl - } // namespace SAX2DOM +} // namespace Arabica #endif diff --git a/include/DOM/Simple/CDATASectionImpl.hpp b/include/DOM/Simple/CDATASectionImpl.hpp index f2271c90..2d468533 100644 --- a/include/DOM/Simple/CDATASectionImpl.hpp +++ b/include/DOM/Simple/CDATASectionImpl.hpp @@ -3,6 +3,8 @@ #include +namespace Arabica +{ namespace SimpleDOM { @@ -54,6 +56,7 @@ class CDATASectionImpl : public DOM::CDATASection_impl, }; // class CDATAImpl } // namespace SAX2DOM +} // namespace Arabica #endif diff --git a/include/DOM/Simple/CharacterDataImpl.hpp b/include/DOM/Simple/CharacterDataImpl.hpp index 196aef4a..54acfc37 100644 --- a/include/DOM/Simple/CharacterDataImpl.hpp +++ b/include/DOM/Simple/CharacterDataImpl.hpp @@ -4,6 +4,8 @@ #include #include +namespace Arabica +{ namespace SimpleDOM { @@ -97,5 +99,7 @@ class CharacterDataImpl : virtual public DOM::CharacterData_impl, }; // class CharacterDataImpl } // namespace SAX2DOM +} // namespace Arabica + #endif diff --git a/include/DOM/Simple/CommentImpl.hpp b/include/DOM/Simple/CommentImpl.hpp index fa32fc84..faa14afe 100644 --- a/include/DOM/Simple/CommentImpl.hpp +++ b/include/DOM/Simple/CommentImpl.hpp @@ -4,6 +4,8 @@ #include #include +namespace Arabica +{ namespace SimpleDOM { @@ -40,6 +42,7 @@ class CommentImpl : public DOM::Comment_impl, }; // class CommentImpl } // namespace SAX2DOM +} // namespace Arabica #endif diff --git a/include/DOM/Simple/DOMImplementation.hpp b/include/DOM/Simple/DOMImplementation.hpp index 9c837703..81e8f378 100644 --- a/include/DOM/Simple/DOMImplementation.hpp +++ b/include/DOM/Simple/DOMImplementation.hpp @@ -7,6 +7,8 @@ #include #include +namespace Arabica +{ namespace SimpleDOM { @@ -87,6 +89,7 @@ class DOMImplementationImpl : public DOM::DOMImplementation_impl }; // class DOMImplementationImpl } // namespace Simple +} // namespace Arabica #endif // end of file diff --git a/include/DOM/Simple/DocumentFragmentImpl.hpp b/include/DOM/Simple/DocumentFragmentImpl.hpp index 265888fd..fe7d27de 100644 --- a/include/DOM/Simple/DocumentFragmentImpl.hpp +++ b/include/DOM/Simple/DocumentFragmentImpl.hpp @@ -3,6 +3,8 @@ #include +namespace Arabica +{ namespace SimpleDOM { @@ -61,8 +63,8 @@ class DocumentFragmentImpl : public DOM::DocumentFragment_impl, } // checkChildType }; // class DocumentFragmentImpl - } // namespace SAX2DOM +} // namespace Arabica #endif diff --git a/include/DOM/Simple/DocumentImpl.hpp b/include/DOM/Simple/DocumentImpl.hpp index b0e8784e..0d91a447 100644 --- a/include/DOM/Simple/DocumentImpl.hpp +++ b/include/DOM/Simple/DocumentImpl.hpp @@ -20,6 +20,8 @@ #include #include +namespace Arabica +{ namespace SimpleDOM { @@ -489,7 +491,8 @@ class DocumentImpl : public DOM::Document_impl, const stringT empty_; }; // class DocumentImpl - } // namespace SAX2DOM +} // namespace Arabica + #endif // end of file diff --git a/include/DOM/Simple/DocumentTypeImpl.hpp b/include/DOM/Simple/DocumentTypeImpl.hpp index 52900343..87f426c1 100644 --- a/include/DOM/Simple/DocumentTypeImpl.hpp +++ b/include/DOM/Simple/DocumentTypeImpl.hpp @@ -5,6 +5,8 @@ #include #include +namespace Arabica +{ namespace SimpleDOM { template class ElementImpl; @@ -124,7 +126,7 @@ class DocumentTypeImpl : public DOM::DocumentType_impl, } // getIDs protected: - void addEntity(SimpleDOM::EntityImpl* entity) + void addEntity(Arabica::SimpleDOM::EntityImpl* entity) { entities_.setReadOnly(false); entity->setOwnerDoc(NodeT::ownerDoc_); @@ -132,7 +134,7 @@ class DocumentTypeImpl : public DOM::DocumentType_impl, entities_.setReadOnly(true); } // setEntity - void addNotation(SimpleDOM::NotationImpl* notation) + void addNotation(Arabica::SimpleDOM::NotationImpl* notation) { notations_.setReadOnly(false); notation->setOwnerDoc(NodeT::ownerDoc_); @@ -140,7 +142,7 @@ class DocumentTypeImpl : public DOM::DocumentType_impl, notations_.setReadOnly(true); } // setNotation - void addElement(SimpleDOM::ElementImpl* element) + void addElement(Arabica::SimpleDOM::ElementImpl* element) { if(elements_.getNamedItem(element->getNodeName()) != 0) { @@ -171,6 +173,7 @@ class DocumentTypeImpl : public DOM::DocumentType_impl, }; // class DOMImplementation } // namespace SAX2DOM +} // namespace Arabica #endif // end of file diff --git a/include/DOM/Simple/ElementByTagImpl.hpp b/include/DOM/Simple/ElementByTagImpl.hpp index 2d8d4752..4a7c3d53 100644 --- a/include/DOM/Simple/ElementByTagImpl.hpp +++ b/include/DOM/Simple/ElementByTagImpl.hpp @@ -4,6 +4,8 @@ #include #include +namespace Arabica +{ namespace SimpleDOM { @@ -134,6 +136,6 @@ class ElementByTagList : public DOM::NodeList_impl }; // class ElementByTagList } // namespace SimpleDOM - +} // namespace Arabica #endif diff --git a/include/DOM/Simple/ElementImpl.hpp b/include/DOM/Simple/ElementImpl.hpp index 93fb0679..4583c968 100644 --- a/include/DOM/Simple/ElementImpl.hpp +++ b/include/DOM/Simple/ElementImpl.hpp @@ -6,6 +6,8 @@ #include #include +namespace Arabica +{ namespace SimpleDOM { @@ -193,8 +195,8 @@ class ElementImpl : public DOM::Element_impl, stringT const* tagName_; }; // class ElementImpl - } // namespace SAX2DOM +} // namespace Arabica #endif diff --git a/include/DOM/Simple/ElementNSImpl.hpp b/include/DOM/Simple/ElementNSImpl.hpp index 2d0a6de1..2d6fbe75 100644 --- a/include/DOM/Simple/ElementNSImpl.hpp +++ b/include/DOM/Simple/ElementNSImpl.hpp @@ -4,6 +4,8 @@ #include #include +namespace Arabica +{ namespace SimpleDOM { @@ -115,8 +117,8 @@ class ElementNSImpl : public ElementImpl bool hasNamespaceURI_; }; // class ElementNSImpl - } // namespace SAX2DOM +} // namespace Arabica #endif diff --git a/include/DOM/Simple/EntityImpl.hpp b/include/DOM/Simple/EntityImpl.hpp index 6d1d8954..569b8219 100644 --- a/include/DOM/Simple/EntityImpl.hpp +++ b/include/DOM/Simple/EntityImpl.hpp @@ -4,6 +4,8 @@ #include #include +namespace Arabica +{ namespace SimpleDOM { @@ -82,8 +84,8 @@ class EntityImpl : public DOM::Entity_impl, stringT notationName_; }; // class EntityImpl - } // namespace SAX2DOM +} // namespace Arabica #endif diff --git a/include/DOM/Simple/EntityReferenceImpl.hpp b/include/DOM/Simple/EntityReferenceImpl.hpp index 4c0bcde8..d91e3a69 100644 --- a/include/DOM/Simple/EntityReferenceImpl.hpp +++ b/include/DOM/Simple/EntityReferenceImpl.hpp @@ -3,6 +3,8 @@ #include +namespace Arabica +{ namespace SimpleDOM { @@ -64,8 +66,8 @@ class EntityReferenceImpl : public DOM::EntityReference_impl, stringT name_; }; // class EntityReferenceImpl - } // namespace SAX2DOM +} // namespace Arabica #endif diff --git a/include/DOM/Simple/Helpers.hpp b/include/DOM/Simple/Helpers.hpp index 630bd6b4..3ef84e36 100644 --- a/include/DOM/Simple/Helpers.hpp +++ b/include/DOM/Simple/Helpers.hpp @@ -4,6 +4,8 @@ #include #include +namespace Arabica +{ namespace SimpleDOM { @@ -48,6 +50,7 @@ std::pair checkPrefixAndNamespace(bool hasPrefix, } // checkPrefixAndNamespace } // namespace SimpleDOM +} // namespace Arabica #endif diff --git a/include/DOM/Simple/NamedNodeMapImpl.hpp b/include/DOM/Simple/NamedNodeMapImpl.hpp index 7abf63c9..2e0bf13e 100644 --- a/include/DOM/Simple/NamedNodeMapImpl.hpp +++ b/include/DOM/Simple/NamedNodeMapImpl.hpp @@ -7,15 +7,17 @@ #include #include +namespace Arabica +{ namespace SimpleDOM { template -class nameIs : public std::unary_function*, bool> +class nameIs : public std::unary_function*, bool> { public: nameIs(const stringT& name) : name_(name) { } - bool operator()(const SimpleDOM::NodeImpl* node) const + bool operator()(const Arabica::SimpleDOM::NodeImpl* node) const { return (node->getNodeName() == name_); } // operator() @@ -211,6 +213,7 @@ class NamedNodeMapImpl : public DOM::NamedNodeMap_impl }; // class NamedNodeMapImpl } // namespace SAX2DOM +} // namespace Arabica #endif diff --git a/include/DOM/Simple/NodeImpl.hpp b/include/DOM/Simple/NodeImpl.hpp index 7fc79047..b0c4b969 100644 --- a/include/DOM/Simple/NodeImpl.hpp +++ b/include/DOM/Simple/NodeImpl.hpp @@ -14,6 +14,8 @@ //#include +namespace Arabica +{ namespace SimpleDOM { @@ -502,6 +504,7 @@ class NodeImplWithChildren : public NodeImpl, }; // class NodeImplWithChildren } // namespace DOM +} // namespace Arabica #endif // JEZUK_DOM_NODE_H // end of file diff --git a/include/DOM/Simple/NotationImpl.hpp b/include/DOM/Simple/NotationImpl.hpp index 74e6c50b..850d131f 100644 --- a/include/DOM/Simple/NotationImpl.hpp +++ b/include/DOM/Simple/NotationImpl.hpp @@ -4,6 +4,8 @@ #include #include +namespace Arabica +{ namespace SimpleDOM { @@ -68,6 +70,7 @@ class NotationImpl : public DOM::Notation_impl, } // namespace SAX2DOM +} // namespace Arabica #endif diff --git a/include/DOM/Simple/ProcessingInstructionImpl.hpp b/include/DOM/Simple/ProcessingInstructionImpl.hpp index 893a2e14..59eb2ba1 100644 --- a/include/DOM/Simple/ProcessingInstructionImpl.hpp +++ b/include/DOM/Simple/ProcessingInstructionImpl.hpp @@ -4,6 +4,8 @@ #include #include +namespace Arabica +{ namespace SimpleDOM { @@ -68,6 +70,7 @@ class ProcessingInstructionImpl : public DOM::ProcessingInstruction_impl #include +namespace Arabica +{ namespace SimpleDOM { @@ -55,6 +57,7 @@ class TextImpl : public DOM::Text_impl, }; // class TextImpl } // namespace SAX2DOM +} // namespace Arabica #endif diff --git a/include/DOM/Text.hpp b/include/DOM/Text.hpp index 396b237c..af8e9833 100644 --- a/include/DOM/Text.hpp +++ b/include/DOM/Text.hpp @@ -9,6 +9,8 @@ #include +namespace Arabica +{ namespace DOM { template class Text_impl; @@ -54,6 +56,7 @@ class Text_impl : virtual public CharacterData_impl }; // Text_impl } // namespace DOM +} // namespace Arabica #endif diff --git a/include/DOM/Traversal/DocumentTraversal.hpp b/include/DOM/Traversal/DocumentTraversal.hpp index c4b83e02..4407ff3e 100644 --- a/include/DOM/Traversal/DocumentTraversal.hpp +++ b/include/DOM/Traversal/DocumentTraversal.hpp @@ -13,6 +13,8 @@ #include #include +namespace Arabica +{ namespace DOM { @@ -124,6 +126,7 @@ class DocumentTraversal_impl : virtual public TraversalImpl } // namespace Traversal } // namespace DOM +} // namespace Arabica #endif // end of file diff --git a/include/DOM/Traversal/DocumentTraversalImpl.hpp b/include/DOM/Traversal/DocumentTraversalImpl.hpp index bd1458fb..de2a7158 100644 --- a/include/DOM/Traversal/DocumentTraversalImpl.hpp +++ b/include/DOM/Traversal/DocumentTraversalImpl.hpp @@ -9,6 +9,8 @@ #include +namespace Arabica +{ namespace DOM { namespace Traversal @@ -48,10 +50,9 @@ DocumentTraversal make_document_traversal_t() return docTraversal; } - - } // namespace Traversal } // namespace DOM +} // namespace Arabica #endif //JEZUK_DOM_TRAVERSAL_DOCUMENT_TRAVERSAL_IMPL_H // end of file diff --git a/include/DOM/Traversal/NodeFilter.hpp b/include/DOM/Traversal/NodeFilter.hpp index 90bac330..f534f9b5 100644 --- a/include/DOM/Traversal/NodeFilter.hpp +++ b/include/DOM/Traversal/NodeFilter.hpp @@ -7,6 +7,8 @@ // $Id$ ///////////////////////////////////////// +namespace Arabica +{ namespace DOM { @@ -36,6 +38,7 @@ class NodeFilter } // namespace Traversal } // namespace DOM +} // namespace Arabica #endif // end of file diff --git a/include/DOM/Traversal/NodeIterator.hpp b/include/DOM/Traversal/NodeIterator.hpp index f4c5ec9a..cdac8b60 100644 --- a/include/DOM/Traversal/NodeIterator.hpp +++ b/include/DOM/Traversal/NodeIterator.hpp @@ -10,6 +10,8 @@ #include #include +namespace Arabica +{ namespace DOM { @@ -80,6 +82,7 @@ class NodeIterator_impl } // namespace Traversal } // namespace DOM +} // namespace Arabica #endif // end of file diff --git a/include/DOM/Traversal/TraversalImpl.hpp b/include/DOM/Traversal/TraversalImpl.hpp index ca1a9b67..0795d4f7 100644 --- a/include/DOM/Traversal/TraversalImpl.hpp +++ b/include/DOM/Traversal/TraversalImpl.hpp @@ -1,6 +1,8 @@ #ifndef JEZUK_DOM_TRAVERSAL_IMPL_H #define JEZUK_DOM_TRAVERSAL_IMPL_H +namespace Arabica +{ namespace DOM { @@ -29,11 +31,9 @@ public: private: int refCount_; - -}; //class Impl - - +}; //class TraversalImpl } // namespace DOM +} // namespace Arabica #endif //JEZUK_DOM_TRAVERSAL_IMPL_H diff --git a/include/DOM/Traversal/TreeWalker.hpp b/include/DOM/Traversal/TreeWalker.hpp index de1aeb19..6872940e 100644 --- a/include/DOM/Traversal/TreeWalker.hpp +++ b/include/DOM/Traversal/TreeWalker.hpp @@ -11,6 +11,8 @@ #include #include +namespace Arabica +{ namespace DOM { @@ -104,6 +106,7 @@ class TreeWalker_impl : public TraversalImpl } // namespace Traversal } // namespace DOM +} // namespace Arabica #endif // end of file diff --git a/include/DOM/Traversal/TreeWalkerImpl.hpp b/include/DOM/Traversal/TreeWalkerImpl.hpp index 23a472d1..5140d324 100644 --- a/include/DOM/Traversal/TreeWalkerImpl.hpp +++ b/include/DOM/Traversal/TreeWalkerImpl.hpp @@ -9,7 +9,8 @@ #include - +namespace Arabica +{ namespace DOM { namespace Traversal @@ -297,5 +298,6 @@ private: } // namespace Traversal } // namespace DOM +} // namespace Arabica #endif //JEZUK_DOM_TRAVERSAL_TREEWALKER_IMPL_H diff --git a/include/DOM/Utils/Stream.hpp b/include/DOM/Utils/Stream.hpp index ffb7adcf..9418b7c6 100644 --- a/include/DOM/Utils/Stream.hpp +++ b/include/DOM/Utils/Stream.hpp @@ -12,7 +12,7 @@ // exists for the DOM::Node's string_type. // // e.g. -// SAX2DOM::Parser domParser; +// Arabica::SAX2DOM::Parser domParser; // SAX::wInputSource is; // ... load instance from somewhere ... // domParser.parse(is); @@ -29,6 +29,8 @@ #include #include +namespace Arabica +{ namespace DOM { @@ -302,4 +304,6 @@ operator<<(std::basic_ostream& stream, } // operator<< } // namespace DOM +} // namespace Arabica + #endif diff --git a/include/XPath/impl/xpath_namespace_node.hpp b/include/XPath/impl/xpath_namespace_node.hpp index d38f2582..b2c2a41f 100644 --- a/include/XPath/impl/xpath_namespace_node.hpp +++ b/include/XPath/impl/xpath_namespace_node.hpp @@ -20,13 +20,13 @@ namespace impl { template > -class NamespaceNodeImpl : public SimpleDOM::ChildlessNodeImpl +class NamespaceNodeImpl : public Arabica::SimpleDOM::ChildlessNodeImpl { - typedef SimpleDOM::ChildlessNodeImpl NodeT; + typedef Arabica::SimpleDOM::ChildlessNodeImpl NodeT; public: NamespaceNodeImpl(stringT localname, stringT value) : - SimpleDOM::ChildlessNodeImpl(0), + Arabica::SimpleDOM::ChildlessNodeImpl(0), localname_(localname), value_(value), ref_(0) diff --git a/tests/DOM/test_Attribute.hpp b/tests/DOM/test_Attribute.hpp index 7737b4ab..552894b8 100644 --- a/tests/DOM/test_Attribute.hpp +++ b/tests/DOM/test_Attribute.hpp @@ -10,7 +10,7 @@ template class AttrTest : public TestCase { - DOM::DOMImplementation factory; + Arabica::DOM::DOMImplementation factory; typedef string_adaptor SA; public: @@ -21,13 +21,13 @@ class AttrTest : public TestCase void setUp() { - factory = SimpleDOM::DOMImplementation::getDOMImplementation(); + factory = Arabica::SimpleDOM::DOMImplementation::getDOMImplementation(); } // setUp void test1() { - DOM::Attr d; - DOM::Node n; + Arabica::DOM::Attr d; + Arabica::DOM::Node n; assert(d == 0); assert(n == 0); assert(n == d); @@ -35,8 +35,8 @@ class AttrTest : public TestCase void test2() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); - DOM::Attr attr = d.createAttribute(SA::construct_from_utf8("attr")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); + Arabica::DOM::Attr attr = d.createAttribute(SA::construct_from_utf8("attr")); assert(attr.getName() == SA::construct_from_utf8("attr")); assert(attr.getNodeName() == SA::construct_from_utf8("attr")); assert(attr.getLocalName() == SA::construct_from_utf8("")); @@ -48,8 +48,8 @@ class AttrTest : public TestCase void test3() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); - DOM::Attr attr = d.createAttributeNS(SA::construct_from_utf8("http://attr"), SA::construct_from_utf8("attr:value")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); + Arabica::DOM::Attr attr = d.createAttributeNS(SA::construct_from_utf8("http://attr"), SA::construct_from_utf8("attr:value")); assert(attr.getName() == SA::construct_from_utf8("attr:value")); assert(attr.getValue() == SA::construct_from_utf8("")); assert(attr.getNodeName() == SA::construct_from_utf8("attr:value")); @@ -63,8 +63,8 @@ class AttrTest : public TestCase void test4() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); - DOM::Attr attr = d.createAttributeNS(SA::construct_from_utf8("http://attr"), SA::construct_from_utf8("attr")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); + Arabica::DOM::Attr attr = d.createAttributeNS(SA::construct_from_utf8("http://attr"), SA::construct_from_utf8("attr")); assert(attr.getName() == SA::construct_from_utf8("attr")); assert(attr.getValue() == SA::construct_from_utf8("")); assert(attr.getNodeName() == SA::construct_from_utf8("attr")); @@ -78,8 +78,8 @@ class AttrTest : public TestCase void test5() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); - DOM::Attr attr = d.createAttributeNS(SA::construct_from_utf8("http://attr"), SA::construct_from_utf8("attr:value")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); + Arabica::DOM::Attr attr = d.createAttributeNS(SA::construct_from_utf8("http://attr"), SA::construct_from_utf8("attr:value")); attr.setPrefix(SA::construct_from_utf8("monkey")); assert(attr.getName() == SA::construct_from_utf8("monkey:value")); @@ -95,8 +95,8 @@ class AttrTest : public TestCase void test6() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); - DOM::Attr attr = d.createAttributeNS(SA::construct_from_utf8("http://attr"), SA::construct_from_utf8("value")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); + Arabica::DOM::Attr attr = d.createAttributeNS(SA::construct_from_utf8("http://attr"), SA::construct_from_utf8("value")); attr.setPrefix(SA::construct_from_utf8("monkey")); assert(attr.getName() == SA::construct_from_utf8("monkey:value")); @@ -112,8 +112,8 @@ class AttrTest : public TestCase void test7() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); - DOM::Attr attr = d.createAttributeNS(SA::construct_from_utf8("http://www.w3.org/2000/xmlns/"), SA::construct_from_utf8("xmlns")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); + Arabica::DOM::Attr attr = d.createAttributeNS(SA::construct_from_utf8("http://www.w3.org/2000/xmlns/"), SA::construct_from_utf8("xmlns")); assert(attr.getName() == SA::construct_from_utf8("xmlns")); assert(attr.getValue() == SA::construct_from_utf8("")); @@ -128,86 +128,86 @@ class AttrTest : public TestCase void test8() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); - DOM::Attr attr; + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); + Arabica::DOM::Attr attr; try { attr = d.createAttributeNS(SA::construct_from_utf8("ppopopop"), SA::construct_from_utf8("xmlns")); } - catch(const DOM::DOMException&) { } + catch(const Arabica::DOM::DOMException&) { } assert(attr == 0); } // test8 void test9() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); - DOM::Attr attr; + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); + Arabica::DOM::Attr attr; try { attr = d.createAttributeNS(SA::construct_from_utf8("ahuafh"), SA::construct_from_utf8("xmlns:billy")); } - catch(const DOM::DOMException&) { } + catch(const Arabica::DOM::DOMException&) { } assert(attr == 0); } // test9 void test10() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); - DOM::Attr attr = d.createAttributeNS(SA::construct_from_utf8("http://www.w3.org/2000/xmlns/"), SA::construct_from_utf8("nothing:much")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); + Arabica::DOM::Attr attr = d.createAttributeNS(SA::construct_from_utf8("http://www.w3.org/2000/xmlns/"), SA::construct_from_utf8("nothing:much")); try { attr.setPrefix(SA::construct_from_utf8("xmlns")); } - catch(const DOM::DOMException&) { } + catch(const Arabica::DOM::DOMException&) { } assert(attr.getPrefix() == SA::construct_from_utf8("xmlns")); } // test10 void test11() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); - DOM::Attr attr = d.createAttributeNS(SA::construct_from_utf8("charles"), SA::construct_from_utf8("nothing:much")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); + Arabica::DOM::Attr attr = d.createAttributeNS(SA::construct_from_utf8("charles"), SA::construct_from_utf8("nothing:much")); try { attr.setPrefix(SA::construct_from_utf8("xmlns")); } - catch(const DOM::DOMException&) { } + catch(const Arabica::DOM::DOMException&) { } assert(attr.getPrefix() == SA::construct_from_utf8("nothing")); } // test11 void test12() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); - DOM::Attr attr = d.createAttributeNS(SA::construct_from_utf8(""), SA::construct_from_utf8("much")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); + Arabica::DOM::Attr attr = d.createAttributeNS(SA::construct_from_utf8(""), SA::construct_from_utf8("much")); try { attr.setPrefix(SA::construct_from_utf8("charles")); } - catch(const DOM::DOMException&) { } + catch(const Arabica::DOM::DOMException&) { } assert(attr.hasPrefix() == false); } // test12 void test13() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); - DOM::Attr attr; + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); + Arabica::DOM::Attr attr; try { attr = d.createAttributeNS(SA::construct_from_utf8(""), SA::construct_from_utf8("trouser:pants")); } - catch(const DOM::DOMException&) { } + catch(const Arabica::DOM::DOMException&) { } assert(attr == 0); } // test13 void test14() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); - DOM::Attr attr = d.createAttributeNS(SA::construct_from_utf8("http://www.w3.org/2000/xmlns/"), SA::construct_from_utf8("xmlns")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); + Arabica::DOM::Attr attr = d.createAttributeNS(SA::construct_from_utf8("http://www.w3.org/2000/xmlns/"), SA::construct_from_utf8("xmlns")); assert(attr.getName() == SA::construct_from_utf8("xmlns")); assert(attr.getValue() == SA::construct_from_utf8("")); diff --git a/tests/DOM/test_CDATA.hpp b/tests/DOM/test_CDATA.hpp index 0da50e14..69acb99f 100644 --- a/tests/DOM/test_CDATA.hpp +++ b/tests/DOM/test_CDATA.hpp @@ -10,7 +10,7 @@ template class CDATATest : public TestCase { - DOM::DOMImplementation factory; + Arabica::DOM::DOMImplementation factory; typedef string_adaptor SA; public: @@ -21,13 +21,13 @@ class CDATATest : public TestCase void setUp() { - factory = SimpleDOM::DOMImplementation::getDOMImplementation(); + factory = Arabica::SimpleDOM::DOMImplementation::getDOMImplementation(); } // setUp void testNull() { - DOM::CDATASection d; - DOM::Node n; + Arabica::DOM::CDATASection d; + Arabica::DOM::Node n; assert(d == 0); assert(n == 0); assert(n == d); @@ -35,8 +35,8 @@ class CDATATest : public TestCase void testCreate() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); - DOM::CDATASection t = d.createCDATASection(SA::construct_from_utf8("some data")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); + Arabica::DOM::CDATASection t = d.createCDATASection(SA::construct_from_utf8("some data")); assert(t.getData() == SA::construct_from_utf8("some data")); assert(t.getNodeName() == SA::construct_from_utf8("#cdata-section")); @@ -48,32 +48,32 @@ class CDATATest : public TestCase void testConversion() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); - DOM::CDATASection t = d.createCDATASection(SA::construct_from_utf8("some data")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); + Arabica::DOM::CDATASection t = d.createCDATASection(SA::construct_from_utf8("some data")); - DOM::Node n; + Arabica::DOM::Node n; assert(n != t); n = t; assert(n == t); - DOM::CDATASection t2; + Arabica::DOM::CDATASection t2; assert(n != t2); - t2 = DOM::CDATASection(n); + t2 = Arabica::DOM::CDATASection(n); assert(t == t2); assert(n == t2); - DOM::CDATASection t3; + Arabica::DOM::CDATASection t3; t3 = t2; assert(t3 == t2); assert(t3 == t); - DOM::Comment c = d.createComment(SA::construct_from_utf8("woo")); + Arabica::DOM::Comment c = d.createComment(SA::construct_from_utf8("woo")); try { - t = DOM::CDATASection(c); + t = Arabica::DOM::CDATASection(c); assertImplementation(false, "converted comment to text"); } catch(const std::bad_cast&) { @@ -82,18 +82,18 @@ class CDATATest : public TestCase void testConversionToText() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); - DOM::CDATASection cd = d.createCDATASection(SA::construct_from_utf8("some data")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); + Arabica::DOM::CDATASection cd = d.createCDATASection(SA::construct_from_utf8("some data")); - DOM::Text t; + Arabica::DOM::Text t; assert(t == 0); assert(cd != t); t = cd; assert(cd == t); - DOM::CDATASection cd2; + Arabica::DOM::CDATASection cd2; assert(cd2 == 0); - cd2 = DOM::CDATASection(t); + cd2 = Arabica::DOM::CDATASection(t); assert(cd2 == t); assert(t == cd2); assert(cd == cd2); @@ -101,7 +101,7 @@ class CDATATest : public TestCase t = d.createTextNode(SA::construct_from_utf8("boom")); try { - cd = DOM::CDATASection(t); + cd = Arabica::DOM::CDATASection(t); assertImplementation(false, "converted text to CDATA"); } catch(const std::bad_cast&) { @@ -110,10 +110,10 @@ class CDATATest : public TestCase void testEverythingElse() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); - DOM::CDATASection t = d.createCDATASection(SA::construct_from_utf8("some data")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); + Arabica::DOM::CDATASection t = d.createCDATASection(SA::construct_from_utf8("some data")); - assert(t.getNodeType() == DOM::Node::CDATA_SECTION_NODE); + assert(t.getNodeType() == Arabica::DOM::Node::CDATA_SECTION_NODE); assert(t.hasAttributes() == false); assert(t.getAttributes() == 0); assert(t.getChildNodes() == 0); @@ -121,9 +121,9 @@ class CDATATest : public TestCase try { - t.appendChild(DOM::Node()); + t.appendChild(Arabica::DOM::Node()); } - catch(const DOM::DOMException&) + catch(const Arabica::DOM::DOMException&) { } diff --git a/tests/DOM/test_CharacterData.hpp b/tests/DOM/test_CharacterData.hpp index 4967adf3..e33d3cf5 100644 --- a/tests/DOM/test_CharacterData.hpp +++ b/tests/DOM/test_CharacterData.hpp @@ -10,7 +10,7 @@ template class CharacterDataTest : public TestCase { - DOM::DOMImplementation factory; + Arabica::DOM::DOMImplementation factory; typedef string_adaptor SA; public: @@ -21,13 +21,13 @@ class CharacterDataTest : public TestCase void setUp() { - factory = SimpleDOM::DOMImplementation::getDOMImplementation(); + factory = Arabica::SimpleDOM::DOMImplementation::getDOMImplementation(); } // setUp void testNull() { - DOM::CharacterData d; - DOM::Node n; + Arabica::DOM::CharacterData d; + Arabica::DOM::Node n; assert(d == 0); assert(n == 0); assert(n == d); @@ -35,8 +35,8 @@ class CharacterDataTest : public TestCase void testCreateText() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); - DOM::CharacterData t = d.createTextNode(SA::construct_from_utf8("some data")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); + Arabica::DOM::CharacterData t = d.createTextNode(SA::construct_from_utf8("some data")); assert(t.getData() == SA::construct_from_utf8("some data")); assert(t.getNodeName() == SA::construct_from_utf8("#text")); @@ -45,7 +45,7 @@ class CharacterDataTest : public TestCase t.setData(SA::construct_from_utf8("newData")); assert(t.getData() == SA::construct_from_utf8("newData")); - assert(t.getNodeType() == DOM::Node::TEXT_NODE); + assert(t.getNodeType() == Arabica::DOM::Node::TEXT_NODE); assert(t.hasAttributes() == false); assert(t.getAttributes() == 0); assert(t.getChildNodes() == 0); @@ -53,9 +53,9 @@ class CharacterDataTest : public TestCase try { - t.appendChild(DOM::Node()); + t.appendChild(Arabica::DOM::Node()); } - catch(const DOM::DOMException&) + catch(const Arabica::DOM::DOMException&) { } @@ -67,8 +67,8 @@ class CharacterDataTest : public TestCase void testCreateCDATA() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); - DOM::CharacterData t = d.createCDATASection(SA::construct_from_utf8("some data")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); + Arabica::DOM::CharacterData t = d.createCDATASection(SA::construct_from_utf8("some data")); assert(t.getData() == SA::construct_from_utf8("some data")); assert(t.getNodeName() == SA::construct_from_utf8("#cdata-section")); @@ -77,7 +77,7 @@ class CharacterDataTest : public TestCase t.setData(SA::construct_from_utf8("newData")); assert(t.getData() == SA::construct_from_utf8("newData")); - assert(t.getNodeType() == DOM::Node::CDATA_SECTION_NODE); + assert(t.getNodeType() == Arabica::DOM::Node::CDATA_SECTION_NODE); assert(t.hasAttributes() == false); assert(t.getAttributes() == 0); assert(t.getChildNodes() == 0); @@ -85,9 +85,9 @@ class CharacterDataTest : public TestCase try { - t.appendChild(DOM::Node()); + t.appendChild(Arabica::DOM::Node()); } - catch(const DOM::DOMException&) + catch(const Arabica::DOM::DOMException&) { } @@ -99,13 +99,13 @@ class CharacterDataTest : public TestCase void testDownCasts() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); - DOM::CDATASection cd = d.createCDATASection(SA::construct_from_utf8("some data")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); + Arabica::DOM::CDATASection cd = d.createCDATASection(SA::construct_from_utf8("some data")); - DOM::Text t = cd; - DOM::CharacterData c = t; + Arabica::DOM::Text t = cd; + Arabica::DOM::CharacterData c = t; - DOM::Node n = c; + Arabica::DOM::Node n = c; assert(c == cd); assert(c == t); @@ -116,11 +116,11 @@ class CharacterDataTest : public TestCase void testTextUpCasts() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); - DOM::Node n = d.createTextNode(SA::construct_from_utf8("some data")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); + Arabica::DOM::Node n = d.createTextNode(SA::construct_from_utf8("some data")); - DOM::CharacterData c = DOM::CharacterData(n); - DOM::Text t = DOM::Text(c); + Arabica::DOM::CharacterData c = Arabica::DOM::CharacterData(n); + Arabica::DOM::Text t = Arabica::DOM::Text(c); assert(c == t); assert(c == n); @@ -129,12 +129,12 @@ class CharacterDataTest : public TestCase void testCDATAUpCasts() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); - DOM::Node n = d.createCDATASection(SA::construct_from_utf8("some data")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); + Arabica::DOM::Node n = d.createCDATASection(SA::construct_from_utf8("some data")); - DOM::CharacterData c = DOM::CharacterData(n); - DOM::Text t = DOM::Text(c); - DOM::CDATASection cd = DOM::CDATASection(c); + Arabica::DOM::CharacterData c = Arabica::DOM::CharacterData(n); + Arabica::DOM::Text t = Arabica::DOM::Text(c); + Arabica::DOM::CDATASection cd = Arabica::DOM::CDATASection(c); assert(c == cd); assert(c == t); diff --git a/tests/DOM/test_DOMImplementation.hpp b/tests/DOM/test_DOMImplementation.hpp index 28a86ef3..61937c83 100644 --- a/tests/DOM/test_DOMImplementation.hpp +++ b/tests/DOM/test_DOMImplementation.hpp @@ -23,11 +23,11 @@ class DOMImplementationTest : public TestCase void testNull() { - DOM::DOMImplementation di; + Arabica::DOM::DOMImplementation di; assert(di == 0); assert(!di); - DOM::DOMImplementation di2 = SimpleDOM::DOMImplementation::getDOMImplementation(); + Arabica::DOM::DOMImplementation di2 = Arabica::SimpleDOM::DOMImplementation::getDOMImplementation(); assert(di2 != 0); assert(di2); @@ -41,7 +41,7 @@ class DOMImplementationTest : public TestCase void testFeatures() { - DOM::DOMImplementation di = SimpleDOM::DOMImplementation::getDOMImplementation(); + Arabica::DOM::DOMImplementation di = Arabica::SimpleDOM::DOMImplementation::getDOMImplementation(); assert(di.hasFeature(SA::construct_from_utf8("Core"), SA::construct_from_utf8("")) == true); assert(di.hasFeature(SA::construct_from_utf8("Core"), SA::construct_from_utf8("1.0")) == true); diff --git a/tests/DOM/test_Document.hpp b/tests/DOM/test_Document.hpp index 6cf2c3e4..195991e5 100644 --- a/tests/DOM/test_Document.hpp +++ b/tests/DOM/test_Document.hpp @@ -10,7 +10,7 @@ template class DocumentTest : public TestCase { - DOM::DOMImplementation factory; + Arabica::DOM::DOMImplementation factory; typedef string_adaptor SA; @@ -22,13 +22,13 @@ class DocumentTest : public TestCase void setUp() { - factory = SimpleDOM::DOMImplementation::getDOMImplementation(); + factory = Arabica::SimpleDOM::DOMImplementation::getDOMImplementation(); } // setUp void testNull() { - DOM::Document d; - DOM::Node n; + Arabica::DOM::Document d; + Arabica::DOM::Node n; assert(d == 0); assert(n == 0); assert(n == d); @@ -38,13 +38,13 @@ class DocumentTest : public TestCase void testAssignment() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); assert(d != 0); assert(d); assert(d.getNodeName() == SA::construct_from_utf8("#document")); assert(d.getNodeValue() == SA::construct_from_utf8("")); - DOM::Node n; + Arabica::DOM::Node n; assert(n == 0); assert(!n); assert(n != d); @@ -53,16 +53,16 @@ class DocumentTest : public TestCase assert(n); assert(n == d); - assert(d == DOM::Document(n)); + assert(d == Arabica::DOM::Document(n)); - DOM::Document d2; + Arabica::DOM::Document d2; assert(d != d2); assert(d2!= d); d2 = d; assert(d == d2); assert(d2 == d); - DOM::Document d3 = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::Document d3 = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); assert(d != d3); assert(d3!= d); d3 = d; @@ -72,11 +72,11 @@ class DocumentTest : public TestCase void testDocElem() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); - DOM::NodeList nl = d.getChildNodes(); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::NodeList nl = d.getChildNodes(); assert(nl.getLength() == 0); - DOM::Element elem = d.createElement(SA::construct_from_utf8("root")); + Arabica::DOM::Element elem = d.createElement(SA::construct_from_utf8("root")); assert(elem.getParentNode() == 0); assert(elem.getOwnerDocument() == d); @@ -89,12 +89,12 @@ class DocumentTest : public TestCase assert(d.getFirstChild() == elem); assert(nl.item(0) == elem); - DOM::Element elem2 = d.createElement(SA::construct_from_utf8("root1")); + Arabica::DOM::Element elem2 = d.createElement(SA::construct_from_utf8("root1")); try { d.appendChild(elem2); } - catch(const DOM::DOMException&) + catch(const Arabica::DOM::DOMException&) { } @@ -115,25 +115,25 @@ class DocumentTest : public TestCase void test4() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); d.appendChild(d.createElement(SA::construct_from_utf8("root"))); d.getFirstChild().appendChild(d.createElement(SA::construct_from_utf8("child"))); d.getFirstChild().appendChild(d.createElement(SA::construct_from_utf8("child2"))); d.getFirstChild().appendChild(d.createElement(SA::construct_from_utf8("child3"))); - DOM::Document clone = DOM::Document(d.cloneNode(false)); + Arabica::DOM::Document clone = Arabica::DOM::Document(d.cloneNode(false)); assert(clone.getFirstChild() == 0); } // test4 void test5() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); d.appendChild(d.createElement(SA::construct_from_utf8("root"))); d.getFirstChild().appendChild(d.createElement(SA::construct_from_utf8("child"))); d.getFirstChild().appendChild(d.createElement(SA::construct_from_utf8("child2"))); d.getFirstChild().appendChild(d.createElement(SA::construct_from_utf8("child3"))); - DOM::Document clone = DOM::Document(d.cloneNode(true)); + Arabica::DOM::Document clone = Arabica::DOM::Document(d.cloneNode(true)); assert(clone.getFirstChild().getNodeName() == SA::construct_from_utf8("root")); assert(clone.getFirstChild().getFirstChild().getNodeName() == SA::construct_from_utf8("child")); assert(clone.getFirstChild().getLastChild().getNodeName() == SA::construct_from_utf8("child3")); @@ -141,30 +141,30 @@ class DocumentTest : public TestCase void test6() { - DOM::Document d1 = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); - DOM::Document d2 = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::Document d1 = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::Document d2 = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); - DOM::Attr a1 = d1.createAttribute(SA::construct_from_utf8("attr")); + Arabica::DOM::Attr a1 = d1.createAttribute(SA::construct_from_utf8("attr")); a1.setNodeValue(SA::construct_from_utf8("value")); - DOM::Node a2 = d2.importNode(a1, true); - assert(a2.getNodeType() == DOM::Node::ATTRIBUTE_NODE); + Arabica::DOM::Node a2 = d2.importNode(a1, true); + assert(a2.getNodeType() == Arabica::DOM::Node::ATTRIBUTE_NODE); assert(a2.getNodeName() == a1.getNodeName()); assert(a2.getNodeValue() == a1.getNodeValue()); assert(a2.getOwnerDocument() == d2); assert(a2.getChildNodes().getLength() == 1); assert(a2.getFirstChild().getNodeValue() == SA::construct_from_utf8("value")); - DOM::Attr asAttr = DOM::Attr(a2); + Arabica::DOM::Attr asAttr = Arabica::DOM::Attr(a2); assert(asAttr.getSpecified()); assert(asAttr.getOwnerElement() == 0); } // test6 void test7() { - DOM::Document d1 = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); - DOM::Document d2 = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::Document d1 = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::Document d2 = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); - DOM::DocumentFragment df1 = d1.createDocumentFragment(); + Arabica::DOM::DocumentFragment df1 = d1.createDocumentFragment(); df1.appendChild(d1.createElement(SA::construct_from_utf8("c1"))); df1.appendChild(d1.createElement(SA::construct_from_utf8("c2"))); df1.appendChild(d1.createElement(SA::construct_from_utf8("c3"))); @@ -174,16 +174,16 @@ class DocumentTest : public TestCase df1.getFirstChild().appendChild(d1.createElement(SA::construct_from_utf8("c3"))); df1.getFirstChild().appendChild(d1.createElement(SA::construct_from_utf8("c4"))); - DOM::Node df2nc = d2.importNode(df1, false); + Arabica::DOM::Node df2nc = d2.importNode(df1, false); assert(df2nc.getOwnerDocument() == d2); assert(df2nc.getChildNodes().getLength() == 0); - DOM::Node df2 = d2.importNode(df1, true); + Arabica::DOM::Node df2 = d2.importNode(df1, true); assert(df2.getOwnerDocument() == d2); - assert(df2.getNodeType() == DOM::Node::DOCUMENT_FRAGMENT_NODE); + assert(df2.getNodeType() == Arabica::DOM::Node::DOCUMENT_FRAGMENT_NODE); assert(df2.getChildNodes().getLength() == 4); assert(df2.getFirstChild().getChildNodes().getLength() == 4); - DOM::NodeList c = df2.getChildNodes(); + Arabica::DOM::NodeList c = df2.getChildNodes(); assert(c.item(0).getNodeName() == SA::construct_from_utf8("c1")); assert(c.item(1).getNodeName() == SA::construct_from_utf8("c2")); assert(c.item(2).getNodeName() == SA::construct_from_utf8("c3")); @@ -201,7 +201,7 @@ class DocumentTest : public TestCase void test8() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); d.appendChild(d.createElement(SA::construct_from_utf8("root"))); d.getFirstChild().appendChild(d.createElement(SA::construct_from_utf8("child"))); d.getFirstChild().appendChild(d.createElement(SA::construct_from_utf8("child"))); @@ -212,7 +212,7 @@ class DocumentTest : public TestCase assert(d.getElementsByTagName(SA::construct_from_utf8("*")).getLength() == 4); assert(d.getElementsByTagNameNS(SA::construct_from_utf8("*"), SA::construct_from_utf8("*")).getLength() == 4); - DOM::NodeList children = d.getElementsByTagName(SA::construct_from_utf8("child")); + Arabica::DOM::NodeList children = d.getElementsByTagName(SA::construct_from_utf8("child")); assert(children.getLength() == 3); assert(children.item(0) == d.getFirstChild().getFirstChild()); @@ -224,13 +224,13 @@ class DocumentTest : public TestCase d.getFirstChild().getLastChild().appendChild(d.createElement(SA::construct_from_utf8("donkey"))); assert(children.getLength() == 5); - assert(DOM::Element(d.getFirstChild().getFirstChild()).getElementsByTagName(SA::construct_from_utf8("donkey")).getLength() == 2); - assert(DOM::Element(d.getFirstChild()).getElementsByTagName(SA::construct_from_utf8("donkey")).getLength() == 4); + assert(Arabica::DOM::Element(d.getFirstChild().getFirstChild()).getElementsByTagName(SA::construct_from_utf8("donkey")).getLength() == 2); + assert(Arabica::DOM::Element(d.getFirstChild()).getElementsByTagName(SA::construct_from_utf8("donkey")).getLength() == 4); } // test8 void test9() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8("root"), 0); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8("root"), 0); assert(d.getFirstChild().getNodeName() == SA::construct_from_utf8("root")); assert(d.getFirstChild().hasPrefix() == false); assert(d.getFirstChild().hasNamespaceURI() == false); @@ -241,7 +241,7 @@ class DocumentTest : public TestCase void test10() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8("http://test/test"), SA::construct_from_utf8("test:root"), 0); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8("http://test/test"), SA::construct_from_utf8("test:root"), 0); assert(d.getFirstChild().getNodeName() == SA::construct_from_utf8("test:root")); assert(d.getFirstChild().hasPrefix() == true); assert(d.getFirstChild().hasNamespaceURI() == true); @@ -252,7 +252,7 @@ class DocumentTest : public TestCase void test11() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8("http://test/test"), SA::construct_from_utf8("root"), 0); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8("http://test/test"), SA::construct_from_utf8("root"), 0); assert(d.getFirstChild().getNodeName() == SA::construct_from_utf8("root")); assert(d.getFirstChild().hasPrefix() == false); assert(d.getFirstChild().hasNamespaceURI() == true); @@ -263,7 +263,7 @@ class DocumentTest : public TestCase void test12() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8("http://test/test"), SA::construct_from_utf8("root"), 0); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8("http://test/test"), SA::construct_from_utf8("root"), 0); assert(d.getFirstChild().getNodeName() == SA::construct_from_utf8("root")); assert(d.getFirstChild().hasPrefix() == false); assert(d.getFirstChild().hasNamespaceURI() == true); @@ -282,8 +282,8 @@ class DocumentTest : public TestCase void test13() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8("http://test/test"), SA::construct_from_utf8("root"), 0); - DOM::Element root = d.getDocumentElement(); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8("http://test/test"), SA::construct_from_utf8("root"), 0); + Arabica::DOM::Element root = d.getDocumentElement(); root.appendChild(d.createTextNode(SA::construct_from_utf8("hello "))); root.appendChild(d.createTextNode(SA::construct_from_utf8("mother, "))); root.appendChild(d.createTextNode(SA::construct_from_utf8("how "))); diff --git a/tests/DOM/test_DocumentFragment.hpp b/tests/DOM/test_DocumentFragment.hpp index ea3bb692..656d1c4a 100644 --- a/tests/DOM/test_DocumentFragment.hpp +++ b/tests/DOM/test_DocumentFragment.hpp @@ -10,7 +10,7 @@ template class DocumentFragmentTest : public TestCase { - DOM::DOMImplementation factory; + Arabica::DOM::DOMImplementation factory; typedef string_adaptor SA; public: @@ -21,13 +21,13 @@ class DocumentFragmentTest : public TestCase void setUp() { - factory = SimpleDOM::DOMImplementation::getDOMImplementation(); + factory = Arabica::SimpleDOM::DOMImplementation::getDOMImplementation(); } // setUp void test1() { - DOM::DocumentFragment d; - DOM::Node n; + Arabica::DOM::DocumentFragment d; + Arabica::DOM::Node n; assert(d == 0); assert(n == 0); assert(n == d); @@ -35,8 +35,8 @@ class DocumentFragmentTest : public TestCase void test2() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); - DOM::DocumentFragment frag = d.createDocumentFragment(); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::DocumentFragment frag = d.createDocumentFragment(); frag.appendChild(d.createElement(SA::construct_from_utf8("child"))); frag.appendChild(d.createElement(SA::construct_from_utf8("child2"))); @@ -47,13 +47,13 @@ class DocumentFragmentTest : public TestCase void test3() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); - DOM::DocumentFragment frag = d.createDocumentFragment(); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::DocumentFragment frag = d.createDocumentFragment(); frag.appendChild(d.createElement(SA::construct_from_utf8("child"))); frag.appendChild(d.createElement(SA::construct_from_utf8("child2"))); frag.appendChild(d.createElement(SA::construct_from_utf8("child3"))); - DOM::Element elem = d.createElement(SA::construct_from_utf8("root")); + Arabica::DOM::Element elem = d.createElement(SA::construct_from_utf8("root")); elem.appendChild(frag); assert(elem.getChildNodes().getLength() == 3); assert(elem.getFirstChild().getNodeName() == SA::construct_from_utf8("child")); @@ -63,13 +63,13 @@ class DocumentFragmentTest : public TestCase void test4() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); - DOM::DocumentFragment frag = d.createDocumentFragment(); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::DocumentFragment frag = d.createDocumentFragment(); frag.appendChild(d.createElement(SA::construct_from_utf8("child"))); frag.appendChild(d.createElement(SA::construct_from_utf8("child2"))); frag.appendChild(d.createElement(SA::construct_from_utf8("child3"))); - DOM::Element elem = d.createElement(SA::construct_from_utf8("root")); + Arabica::DOM::Element elem = d.createElement(SA::construct_from_utf8("root")); elem.appendChild(d.createElement(SA::construct_from_utf8("t"))); assert(elem.getChildNodes().getLength() == 1); @@ -82,13 +82,13 @@ class DocumentFragmentTest : public TestCase void test5() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); - DOM::DocumentFragment frag = d.createDocumentFragment(); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::DocumentFragment frag = d.createDocumentFragment(); frag.appendChild(d.createElement(SA::construct_from_utf8("child"))); frag.appendChild(d.createElement(SA::construct_from_utf8("child2"))); frag.appendChild(d.createElement(SA::construct_from_utf8("child3"))); - DOM::Element elem = d.createElement(SA::construct_from_utf8("root")); + Arabica::DOM::Element elem = d.createElement(SA::construct_from_utf8("root")); elem.appendChild(d.createElement(SA::construct_from_utf8("t"))); assert(elem.getChildNodes().getLength() == 1); diff --git a/tests/DOM/test_DocumentType.hpp b/tests/DOM/test_DocumentType.hpp index 37959080..e17d203a 100644 --- a/tests/DOM/test_DocumentType.hpp +++ b/tests/DOM/test_DocumentType.hpp @@ -10,7 +10,7 @@ template class DocumentTypeTest : public TestCase { - DOM::DOMImplementation factory; + Arabica::DOM::DOMImplementation factory; typedef string_adaptor SA; public: @@ -21,13 +21,13 @@ class DocumentTypeTest : public TestCase void setUp() { - factory = SimpleDOM::DOMImplementation::getDOMImplementation(); + factory = Arabica::SimpleDOM::DOMImplementation::getDOMImplementation(); } // setUp void testNull() { - DOM::DocumentType d; - DOM::Node n; + Arabica::DOM::DocumentType d; + Arabica::DOM::Node n; assert(d == 0); assert(n == 0); assert(n == d); @@ -35,28 +35,28 @@ class DocumentTypeTest : public TestCase void testCreate() { - DOM::DocumentType d = factory.createDocumentType(SA::construct_from_utf8("charlie"), + Arabica::DOM::DocumentType d = factory.createDocumentType(SA::construct_from_utf8("charlie"), SA::construct_from_utf8(""), SA::construct_from_utf8("http://gruesome/")); assert(d != 0); - DOM::Node n; + Arabica::DOM::Node n; assert(n == 0); assert(n != d); n = d; assert(n == d); - assert(d == DOM::DocumentType(n)); + assert(d == Arabica::DOM::DocumentType(n)); - DOM::DocumentType d2; + Arabica::DOM::DocumentType d2; assert(d != d2); assert(d2 != d); d2 = d; assert(d == d2); assert(d2 == d); - DOM::DocumentType d3 = factory.createDocumentType(SA::construct_from_utf8("billy"), + Arabica::DOM::DocumentType d3 = factory.createDocumentType(SA::construct_from_utf8("billy"), SA::construct_from_utf8(""), SA::construct_from_utf8("http://gruesome/")); assert(d != d3); @@ -68,15 +68,15 @@ class DocumentTypeTest : public TestCase void testDoc() { - DOM::DocumentType d = factory.createDocumentType(SA::construct_from_utf8("charlie"), + Arabica::DOM::DocumentType d = factory.createDocumentType(SA::construct_from_utf8("charlie"), SA::construct_from_utf8("sss"), SA::construct_from_utf8("http://gruesome/")); - DOM::Document doc = factory.createDocument(SA::construct_from_utf8(""), + Arabica::DOM::Document doc = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8("doc"), d); - DOM::DocumentType dt = doc.getDoctype(); + Arabica::DOM::DocumentType dt = doc.getDoctype(); assert(dt.getPublicId() == SA::construct_from_utf8("sss")); assert(dt.getSystemId() == SA::construct_from_utf8("http://gruesome/")); assert(dt.getNodeName() == SA::construct_from_utf8("charlie")); diff --git a/tests/DOM/test_Element.hpp b/tests/DOM/test_Element.hpp index ee2941df..a210e4fe 100644 --- a/tests/DOM/test_Element.hpp +++ b/tests/DOM/test_Element.hpp @@ -10,7 +10,7 @@ template class ElementTest : public TestCase { - DOM::DOMImplementation factory; + Arabica::DOM::DOMImplementation factory; typedef string_adaptor SA; public: @@ -21,13 +21,13 @@ class ElementTest : public TestCase void setUp() { - factory = SimpleDOM::DOMImplementation::getDOMImplementation(); + factory = Arabica::SimpleDOM::DOMImplementation::getDOMImplementation(); } // setUp void test1() { - DOM::Element d; - DOM::Node n; + Arabica::DOM::Element d; + Arabica::DOM::Node n; assert(d == 0); assert(n == 0); assert(n == d); @@ -35,43 +35,43 @@ class ElementTest : public TestCase void test2() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); - DOM::Element elem = d.createElement(SA::construct_from_utf8("root")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::Element elem = d.createElement(SA::construct_from_utf8("root")); assert(elem.getParentNode() == 0); assert(elem.getOwnerDocument() == d); d.appendChild(elem); - DOM::Element child = d.createElement(SA::construct_from_utf8("child")); + Arabica::DOM::Element child = d.createElement(SA::construct_from_utf8("child")); elem.appendChild(child); } // test2 void test3() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); - DOM::Element elem = d.createElement(SA::construct_from_utf8("root")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::Element elem = d.createElement(SA::construct_from_utf8("root")); assert(elem.getParentNode() == 0); assert(elem.getOwnerDocument() == d); d.appendChild(elem); - DOM::Attr attr = d.createAttribute(SA::construct_from_utf8("attr")); + Arabica::DOM::Attr attr = d.createAttribute(SA::construct_from_utf8("attr")); attr.setNodeValue(SA::construct_from_utf8("trousers")); try { elem.appendChild(attr); } - catch(const DOM::DOMException&) { } + catch(const Arabica::DOM::DOMException&) { } assert(elem.getFirstChild() == 0); } // test3 void test4() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); - DOM::Element elem = d.createElement(SA::construct_from_utf8("root")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::Element elem = d.createElement(SA::construct_from_utf8("root")); assert(elem.getParentNode() == 0); assert(elem.getOwnerDocument() == d); d.appendChild(elem); - DOM::Attr attr = d.createAttribute(SA::construct_from_utf8("attr")); + Arabica::DOM::Attr attr = d.createAttribute(SA::construct_from_utf8("attr")); elem.setAttributeNode(attr); assert(elem.getAttributeNode(SA::construct_from_utf8("attr")) == attr); assert(elem.removeAttributeNode(attr) == attr); @@ -79,8 +79,8 @@ class ElementTest : public TestCase void test5() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); - DOM::Element elem = d.createElement(SA::construct_from_utf8("root")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::Element elem = d.createElement(SA::construct_from_utf8("root")); assert(elem.getParentNode() == 0); assert(elem.getOwnerDocument() == d); d.appendChild(elem); @@ -91,15 +91,15 @@ class ElementTest : public TestCase assert(elem.hasAttributes() == true); assert(elem.hasAttribute(SA::construct_from_utf8("attr")) == true); - DOM::Node n = elem.getAttributeNode(SA::construct_from_utf8("attr")); + Arabica::DOM::Node n = elem.getAttributeNode(SA::construct_from_utf8("attr")); assert(n.getNodeValue() == SA::construct_from_utf8("poop")); assert(elem.setAttributeNode(d.createAttribute(SA::construct_from_utf8("attr"))) == n); } // test5 void test6() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); - DOM::Element elem = d.createElement(SA::construct_from_utf8("root")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::Element elem = d.createElement(SA::construct_from_utf8("root")); assert(elem.getParentNode() == 0); assert(elem.getOwnerDocument() == d); d.appendChild(elem); @@ -116,12 +116,12 @@ class ElementTest : public TestCase void test7() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); - DOM::Element elem = d.createElement(SA::construct_from_utf8("root")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::Element elem = d.createElement(SA::construct_from_utf8("root")); elem.setAttribute(SA::construct_from_utf8("attr"), SA::construct_from_utf8("poop")); elem.appendChild(d.createElement(SA::construct_from_utf8("child"))); - DOM::Element e2 = DOM::Element(elem.cloneNode(false)); + Arabica::DOM::Element e2 = Arabica::DOM::Element(elem.cloneNode(false)); assert(e2.getOwnerDocument() == d); assert(e2.getParentNode() == 0); assert(e2.hasAttributes() == true); @@ -131,12 +131,12 @@ class ElementTest : public TestCase void test8() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); - DOM::Element elem = d.createElement(SA::construct_from_utf8("root")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::Element elem = d.createElement(SA::construct_from_utf8("root")); elem.setAttribute(SA::construct_from_utf8("attr"), SA::construct_from_utf8("poop")); elem.appendChild(d.createElement(SA::construct_from_utf8("child"))); - DOM::Element e2 = DOM::Element(elem.cloneNode(true)); + Arabica::DOM::Element e2 = Arabica::DOM::Element(elem.cloneNode(true)); assert(e2.getOwnerDocument() == d); assert(e2.getParentNode() == 0); assert(e2.hasAttributes() == true); diff --git a/tests/DOM/test_ProcessingInstruction.hpp b/tests/DOM/test_ProcessingInstruction.hpp index 46fc3a02..7af2cc45 100644 --- a/tests/DOM/test_ProcessingInstruction.hpp +++ b/tests/DOM/test_ProcessingInstruction.hpp @@ -10,7 +10,7 @@ template class PITest : public TestCase { - DOM::DOMImplementation factory; + Arabica::DOM::DOMImplementation factory; typedef string_adaptor SA; public: @@ -21,13 +21,13 @@ class PITest : public TestCase void setUp() { - factory = SimpleDOM::DOMImplementation::getDOMImplementation(); + factory = Arabica::SimpleDOM::DOMImplementation::getDOMImplementation(); } // setUp void testNull() { - DOM::ProcessingInstruction d; - DOM::Node n; + Arabica::DOM::ProcessingInstruction d; + Arabica::DOM::Node n; assert(d == 0); assert(n == 0); assert(n == d); @@ -35,8 +35,8 @@ class PITest : public TestCase void testCreate() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); - DOM::ProcessingInstruction p = d.createProcessingInstruction(SA::construct_from_utf8("target"), SA::construct_from_utf8("data")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::ProcessingInstruction p = d.createProcessingInstruction(SA::construct_from_utf8("target"), SA::construct_from_utf8("data")); assert(p.getTarget() == SA::construct_from_utf8("target")); assert(p.getData() == SA::construct_from_utf8("data")); @@ -49,10 +49,10 @@ class PITest : public TestCase void testConversion() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); - DOM::ProcessingInstruction pi = d.createProcessingInstruction(SA::construct_from_utf8("target"), SA::construct_from_utf8("data")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::ProcessingInstruction pi = d.createProcessingInstruction(SA::construct_from_utf8("target"), SA::construct_from_utf8("data")); - DOM::Node n; + Arabica::DOM::Node n; assert(n != pi); @@ -60,20 +60,20 @@ class PITest : public TestCase assert(n == pi); - DOM::ProcessingInstruction pi2; + Arabica::DOM::ProcessingInstruction pi2; assert(n != pi2); - pi2 = DOM::ProcessingInstruction(n); + pi2 = Arabica::DOM::ProcessingInstruction(n); assert(pi == pi2); assert(n == pi2); } // testConverstion void testEverythingElse() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); - DOM::ProcessingInstruction pi = d.createProcessingInstruction(SA::construct_from_utf8("target"), SA::construct_from_utf8("data")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::ProcessingInstruction pi = d.createProcessingInstruction(SA::construct_from_utf8("target"), SA::construct_from_utf8("data")); - assert(pi.getNodeType() == DOM::Node::PROCESSING_INSTRUCTION_NODE); + assert(pi.getNodeType() == Arabica::DOM::Node::PROCESSING_INSTRUCTION_NODE); assert(pi.hasAttributes() == false); assert(pi.getAttributes() == 0); assert(pi.getChildNodes() == 0); @@ -81,9 +81,9 @@ class PITest : public TestCase try { - pi.appendChild(DOM::Node()); + pi.appendChild(Arabica::DOM::Node()); } - catch(const DOM::DOMException&) + catch(const Arabica::DOM::DOMException&) { } diff --git a/tests/DOM/test_SAX2DOM.hpp b/tests/DOM/test_SAX2DOM.hpp index 62d3abbb..67fdd08f 100644 --- a/tests/DOM/test_SAX2DOM.hpp +++ b/tests/DOM/test_SAX2DOM.hpp @@ -23,14 +23,14 @@ class SAX2DOMTest : public TestCase { } // setUp - DOM::Document parse(string_type str) + Arabica::DOM::Document parse(string_type str) { std::stringstream ss; ss << SA::asStdString(str); Arabica::SAX::basic_InputSource is(ss); Arabica::SAX::CatchErrorHandler eh; - SAX2DOM::Parser parser; + Arabica::SAX2DOM::Parser parser; parser.setErrorHandler(eh); parser.parse(is); @@ -42,8 +42,8 @@ class SAX2DOMTest : public TestCase void test1() { - DOM::Element d; - DOM::Node n; + Arabica::DOM::Element d; + Arabica::DOM::Node n; assert(d == 0); assert(n == 0); assert(n == d); @@ -51,24 +51,24 @@ class SAX2DOMTest : public TestCase void test2() { - DOM::Document d = parse(SA::construct_from_utf8("")); - DOM::Element elem = d.getDocumentElement(); + Arabica::DOM::Document d = parse(SA::construct_from_utf8("")); + Arabica::DOM::Element elem = d.getDocumentElement(); assert(elem.getParentNode() == d); assert(elem.getOwnerDocument() == d); } // test2 void test3() { - DOM::Document d = parse(SA::construct_from_utf8("")); - DOM::Element elem = d.getDocumentElement(); + Arabica::DOM::Document d = parse(SA::construct_from_utf8("")); + Arabica::DOM::Element elem = d.getDocumentElement(); assert(elem.hasAttributes() == true); assert(elem.getAttribute(SA::construct_from_utf8("attr")) == SA::construct_from_utf8("poop")); } // test3 void test4() { - DOM::Document d = parse(SA::construct_from_utf8("")); - DOM::Element elem = DOM::Element(d.getDocumentElement().getFirstChild()); + Arabica::DOM::Document d = parse(SA::construct_from_utf8("")); + Arabica::DOM::Element elem = Arabica::DOM::Element(d.getDocumentElement().getFirstChild()); assert(SA::construct_from_utf8("child") == elem.getNodeName()); assertEquals(true, elem.hasAttributes()); assert(SA::construct_from_utf8("poop") == elem.getAttribute(SA::construct_from_utf8("attr"))); @@ -76,44 +76,44 @@ class SAX2DOMTest : public TestCase void test5() { - DOM::Document d = parse(SA::construct_from_utf8("")); - DOM::Element elem = d.getDocumentElement(); + Arabica::DOM::Document d = parse(SA::construct_from_utf8("")); + Arabica::DOM::Element elem = d.getDocumentElement(); assertEquals(true, elem.hasNamespaceURI()); assert(SA::construct_from_utf8("http://example.com/stuff") == elem.getNamespaceURI()); - DOM::Attr attr = elem.getAttributeNode(SA::construct_from_utf8("attr")); + Arabica::DOM::Attr attr = elem.getAttributeNode(SA::construct_from_utf8("attr")); assertEquals(false, attr.hasNamespaceURI()); } // test5 void test6() { - DOM::Document d = parse(SA::construct_from_utf8("")); - DOM::Element elem = d.getDocumentElement(); + Arabica::DOM::Document d = parse(SA::construct_from_utf8("")); + Arabica::DOM::Element elem = d.getDocumentElement(); assertEquals(true, elem.hasNamespaceURI()); assert(SA::construct_from_utf8("http://example.com/stuff") == elem.getNamespaceURI()); - DOM::Attr attr = elem.getAttributeNodeNS(SA::construct_from_utf8("http://example.com/stuff"), SA::construct_from_utf8("attr")); + Arabica::DOM::Attr attr = elem.getAttributeNodeNS(SA::construct_from_utf8("http://example.com/stuff"), SA::construct_from_utf8("attr")); assertEquals(true, attr.hasNamespaceURI()); assert(SA::construct_from_utf8("http://example.com/stuff") == attr.getNamespaceURI()); } // test6 void test7() { - DOM::Document d = parse(SA::construct_from_utf8("")); - DOM::Element elem = d.getDocumentElement(); + Arabica::DOM::Document d = parse(SA::construct_from_utf8("")); + Arabica::DOM::Element elem = d.getDocumentElement(); assertEquals(false, elem.hasNamespaceURI()); - DOM::Attr attr = elem.getAttributeNodeNS(SA::construct_from_utf8("http://example.com/stuff"), SA::construct_from_utf8("attr")); + Arabica::DOM::Attr attr = elem.getAttributeNodeNS(SA::construct_from_utf8("http://example.com/stuff"), SA::construct_from_utf8("attr")); assertEquals(true, attr.hasNamespaceURI()); assert(SA::construct_from_utf8("http://example.com/stuff") == attr.getNamespaceURI()); } // test7 void test8() { - DOM::Document d = parse(SA::construct_from_utf8("")); - DOM::Element elem = d.getDocumentElement(); + Arabica::DOM::Document d = parse(SA::construct_from_utf8("")); + Arabica::DOM::Element elem = d.getDocumentElement(); - DOM::Element e2 = DOM::Element(elem.cloneNode(true)); + Arabica::DOM::Element e2 = Arabica::DOM::Element(elem.cloneNode(true)); assert(e2.getOwnerDocument() == d); assert(e2.getParentNode() == 0); assert(e2.hasAttributes() == true); @@ -123,23 +123,23 @@ class SAX2DOMTest : public TestCase void test9() { - DOM::Document d = parse(SA::construct_from_utf8("")); - DOM::Element elem = d.getDocumentElement(); + Arabica::DOM::Document d = parse(SA::construct_from_utf8("")); + Arabica::DOM::Element elem = d.getDocumentElement(); assertEquals(false, elem.hasNamespaceURI()); - DOM::Attr attr = elem.getAttributeNode(SA::construct_from_utf8("attr")); + Arabica::DOM::Attr attr = elem.getAttributeNode(SA::construct_from_utf8("attr")); assertEquals(false, attr.hasNamespaceURI()); } // test9 void test10() { - DOM::Document d = parse(SA::construct_from_utf8("")); + Arabica::DOM::Document d = parse(SA::construct_from_utf8("")); assert(d == 0); } // test10 void test11() { - SAX2DOM::Parser parser; + Arabica::SAX2DOM::Parser parser; assert(parser.getFeature(SA::construct_from_utf8("http://xml.org/sax/features/validation")) == false); parser.setFeature(SA::construct_from_utf8("http://xml.org/sax/features/validation"), true); assert(parser.getFeature(SA::construct_from_utf8("http://xml.org/sax/features/validation")) == true); @@ -151,7 +151,7 @@ class SAX2DOMTest : public TestCase void test12() { - SAX2DOM::Parser parser; + Arabica::SAX2DOM::Parser parser; try { parser.getFeature(SA::construct_from_utf8("made up name")); diff --git a/tests/DOM/test_Siblings.hpp b/tests/DOM/test_Siblings.hpp index bc86c0ce..dc48ac15 100644 --- a/tests/DOM/test_Siblings.hpp +++ b/tests/DOM/test_Siblings.hpp @@ -10,7 +10,7 @@ template class SiblingsTest : public TestCase { - DOM::DOMImplementation factory; + Arabica::DOM::DOMImplementation factory; typedef string_adaptor SA; public: @@ -21,19 +21,19 @@ class SiblingsTest : public TestCase void setUp() { - factory = SimpleDOM::DOMImplementation::getDOMImplementation(); + factory = Arabica::SimpleDOM::DOMImplementation::getDOMImplementation(); } // setUp void test1() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); - DOM::Element root = d.createElement(SA::construct_from_utf8("root")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::Element root = d.createElement(SA::construct_from_utf8("root")); d.appendChild(root); assert(root.getPreviousSibling() == 0); assert(root.getNextSibling() == 0); - DOM::ProcessingInstruction p = d.createProcessingInstruction(SA::construct_from_utf8("target"), SA::construct_from_utf8("data")); + Arabica::DOM::ProcessingInstruction p = d.createProcessingInstruction(SA::construct_from_utf8("target"), SA::construct_from_utf8("data")); d.insertBefore(p, root); assert(d.getFirstChild() == p); assert(d.getLastChild() == root); @@ -42,7 +42,7 @@ class SiblingsTest : public TestCase assert(root.getPreviousSibling() == p); assert(root.getNextSibling() == 0); - DOM::ProcessingInstruction p2 = d.createProcessingInstruction(SA::construct_from_utf8("target"), SA::construct_from_utf8("data")); + Arabica::DOM::ProcessingInstruction p2 = d.createProcessingInstruction(SA::construct_from_utf8("target"), SA::construct_from_utf8("data")); d.insertBefore(p2, root); assert(d.getFirstChild() == p); assert(d.getLastChild() == root); @@ -106,30 +106,30 @@ class SiblingsTest : public TestCase void test2() { - DOM::Element root; + Arabica::DOM::Element root; { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); root = d.createElement(SA::construct_from_utf8("root")); d.appendChild(root); assert(root.getPreviousSibling() == 0); assert(root.getNextSibling() == 0); - DOM::ProcessingInstruction p = d.createProcessingInstruction(SA::construct_from_utf8("target"), SA::construct_from_utf8("data")); + Arabica::DOM::ProcessingInstruction p = d.createProcessingInstruction(SA::construct_from_utf8("target"), SA::construct_from_utf8("data")); d.insertBefore(p, root); } - DOM::Node n = root.getPreviousSibling(); - DOM::ProcessingInstruction p = DOM::ProcessingInstruction(n); + Arabica::DOM::Node n = root.getPreviousSibling(); + Arabica::DOM::ProcessingInstruction p = Arabica::DOM::ProcessingInstruction(n); assert(p.getTarget() == SA::construct_from_utf8("target")); assert(p.getData() == SA::construct_from_utf8("data")); } // test2 void test3() { - DOM::Element root; + Arabica::DOM::Element root; { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); root = d.createElement(SA::construct_from_utf8("root")); d.appendChild(root); @@ -137,7 +137,7 @@ class SiblingsTest : public TestCase root.appendChild(d.createElement(SA::construct_from_utf8("child2"))); } - DOM::Node c = root.getFirstChild(); + Arabica::DOM::Node c = root.getFirstChild(); assert(c.getNextSibling() == root.getLastChild()); root.purgeChild(c); @@ -148,9 +148,9 @@ class SiblingsTest : public TestCase void test4() { - DOM::Element root; + Arabica::DOM::Element root; { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); root = d.createElement(SA::construct_from_utf8("root")); d.appendChild(root); @@ -158,15 +158,15 @@ class SiblingsTest : public TestCase root.appendChild(d.createElement(SA::construct_from_utf8("child2"))); } - DOM::Node c1 = root.getFirstChild(); - DOM::Node c2 = root.getLastChild(); + Arabica::DOM::Node c1 = root.getFirstChild(); + Arabica::DOM::Node c2 = root.getLastChild(); try { c1.purgeChild(c2); } - catch(DOM::DOMException& e) + catch(Arabica::DOM::DOMException& e) { - assert(e.code() == DOM::DOMException::NOT_FOUND_ERR); + assert(e.code() == Arabica::DOM::DOMException::NOT_FOUND_ERR); } // catch diff --git a/tests/DOM/test_Text.hpp b/tests/DOM/test_Text.hpp index cf6de47f..1897b313 100644 --- a/tests/DOM/test_Text.hpp +++ b/tests/DOM/test_Text.hpp @@ -10,7 +10,7 @@ template class TextTest : public TestCase { - DOM::DOMImplementation factory; + Arabica::DOM::DOMImplementation factory; typedef string_adaptor SA; public: @@ -21,13 +21,13 @@ class TextTest : public TestCase void setUp() { - factory = SimpleDOM::DOMImplementation::getDOMImplementation(); + factory = Arabica::SimpleDOM::DOMImplementation::getDOMImplementation(); } // setUp void testNull() { - DOM::Text d; - DOM::Node n; + Arabica::DOM::Text d; + Arabica::DOM::Node n; assert(d == 0); assert(n == 0); assert(n == d); @@ -35,8 +35,8 @@ class TextTest : public TestCase void testCreate() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); - DOM::Text t = d.createTextNode(SA::construct_from_utf8("some data")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8(""), 0); + Arabica::DOM::Text t = d.createTextNode(SA::construct_from_utf8("some data")); assert(t.getData() == SA::construct_from_utf8("some data")); assert(t.getNodeName() == SA::construct_from_utf8("#text")); @@ -48,32 +48,32 @@ class TextTest : public TestCase void testConversion() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); - DOM::Text t = d.createTextNode(SA::construct_from_utf8("some data")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); + Arabica::DOM::Text t = d.createTextNode(SA::construct_from_utf8("some data")); - DOM::Node n; + Arabica::DOM::Node n; assert(n != t); n = t; assert(n == t); - DOM::Text t2; + Arabica::DOM::Text t2; assert(n != t2); - t2 = DOM::Text(n); + t2 = Arabica::DOM::Text(n); assert(t == t2); assert(n == t2); - DOM::Text t3; + Arabica::DOM::Text t3; t3 = t2; assert(t3 == t2); assert(t3 == t); - DOM::Comment c = d.createComment(SA::construct_from_utf8("woo")); + Arabica::DOM::Comment c = d.createComment(SA::construct_from_utf8("woo")); try { - t = DOM::Text(c); + t = Arabica::DOM::Text(c); assertImplementation(false, "converted comment to text"); } catch(const std::bad_cast&) { @@ -82,10 +82,10 @@ class TextTest : public TestCase void testEverythingElse() { - DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); - DOM::Text t = d.createTextNode(SA::construct_from_utf8("some data")); + Arabica::DOM::Document d = factory.createDocument(SA::construct_from_utf8(""),SA::construct_from_utf8(""), 0); + Arabica::DOM::Text t = d.createTextNode(SA::construct_from_utf8("some data")); - assert(t.getNodeType() == DOM::Node::TEXT_NODE); + assert(t.getNodeType() == Arabica::DOM::Node::TEXT_NODE); assert(t.hasAttributes() == false); assert(t.getAttributes() == 0); assert(t.getChildNodes() == 0); @@ -93,9 +93,9 @@ class TextTest : public TestCase try { - t.appendChild(DOM::Node()); + t.appendChild(Arabica::DOM::Node()); } - catch(const DOM::DOMException&) + catch(const Arabica::DOM::DOMException&) { } diff --git a/tests/DOM/test_TreeWalker.hpp b/tests/DOM/test_TreeWalker.hpp index 9e681b01..77e0b8ff 100644 --- a/tests/DOM/test_TreeWalker.hpp +++ b/tests/DOM/test_TreeWalker.hpp @@ -23,14 +23,14 @@ class TreeWalkerTest : public TestCase { } // setUp - DOM::Document parse(string_type str) + Arabica::DOM::Document parse(string_type str) { std::stringstream ss; ss << SA::asStdString(str); Arabica::SAX::basic_InputSource is(ss); Arabica::SAX::CatchErrorHandler eh; - SAX2DOM::Parser parser; + Arabica::SAX2DOM::Parser parser; parser.setErrorHandler(eh); parser.parse(is); @@ -42,14 +42,14 @@ class TreeWalkerTest : public TestCase void test1() { - DOM::Document d = parse(SA::construct_from_utf8("")); - DOM::Element elem = d.getDocumentElement(); + Arabica::DOM::Document d = parse(SA::construct_from_utf8("")); + Arabica::DOM::Element elem = d.getDocumentElement(); - DOM::Traversal::DocumentTraversal traversal = d.createDocumentTraversal(); - DOM::Traversal::TreeWalker walker = traversal.createTreeWalker(d.getDocumentElement(), - DOM::Traversal::SHOW_ALL, + Arabica::DOM::Traversal::DocumentTraversal traversal = d.createDocumentTraversal(); + Arabica::DOM::Traversal::TreeWalker walker = traversal.createTreeWalker(d.getDocumentElement(), + Arabica::DOM::Traversal::SHOW_ALL, true); - assert(walker.getWhatToShow() == DOM::Traversal::SHOW_ALL); + assert(walker.getWhatToShow() == Arabica::DOM::Traversal::SHOW_ALL); assert(walker.getFilter() == 0); assert(walker.getCurrentNode() == elem); assert(walker.nextNode() == 0); @@ -57,12 +57,12 @@ class TreeWalkerTest : public TestCase void test2() { - DOM::Document d = parse(SA::construct_from_utf8("")); - DOM::Element elem = d.getDocumentElement(); + Arabica::DOM::Document d = parse(SA::construct_from_utf8("")); + Arabica::DOM::Element elem = d.getDocumentElement(); - DOM::Traversal::DocumentTraversal traversal = d.createDocumentTraversal(); - DOM::Traversal::TreeWalker walker = traversal.createTreeWalker(d.getDocumentElement(), - DOM::Traversal::SHOW_ALL, + Arabica::DOM::Traversal::DocumentTraversal traversal = d.createDocumentTraversal(); + Arabica::DOM::Traversal::TreeWalker walker = traversal.createTreeWalker(d.getDocumentElement(), + Arabica::DOM::Traversal::SHOW_ALL, true); assert(walker.getCurrentNode() == elem); assert(walker.nextNode() == elem.getFirstChild()); @@ -72,12 +72,12 @@ class TreeWalkerTest : public TestCase void test3() { - DOM::Document d = parse(SA::construct_from_utf8("hellomother")); - DOM::Element elem = d.getDocumentElement(); + Arabica::DOM::Document d = parse(SA::construct_from_utf8("hellomother")); + Arabica::DOM::Element elem = d.getDocumentElement(); - DOM::Traversal::DocumentTraversal traversal = d.createDocumentTraversal(); - DOM::Traversal::TreeWalker walker = traversal.createTreeWalker(d.getDocumentElement(), - DOM::Traversal::SHOW_ALL, + Arabica::DOM::Traversal::DocumentTraversal traversal = d.createDocumentTraversal(); + Arabica::DOM::Traversal::TreeWalker walker = traversal.createTreeWalker(d.getDocumentElement(), + Arabica::DOM::Traversal::SHOW_ALL, true); assert(walker.getCurrentNode() == elem); assert(walker.nextNode() == elem.getFirstChild()); @@ -89,12 +89,12 @@ class TreeWalkerTest : public TestCase void test4() { - DOM::Document d = parse(SA::construct_from_utf8("hellomother")); - DOM::Element elem = d.getDocumentElement(); + Arabica::DOM::Document d = parse(SA::construct_from_utf8("hellomother")); + Arabica::DOM::Element elem = d.getDocumentElement(); - DOM::Traversal::DocumentTraversal traversal = d.createDocumentTraversal(); - DOM::Traversal::TreeWalker walker = traversal.createTreeWalker(d.getDocumentElement(), - DOM::Traversal::SHOW_ELEMENT, + Arabica::DOM::Traversal::DocumentTraversal traversal = d.createDocumentTraversal(); + Arabica::DOM::Traversal::TreeWalker walker = traversal.createTreeWalker(d.getDocumentElement(), + Arabica::DOM::Traversal::SHOW_ELEMENT, true); assert(walker.getCurrentNode() == elem); assert(walker.nextNode() == elem.getFirstChild()); @@ -104,12 +104,12 @@ class TreeWalkerTest : public TestCase void test5() { - DOM::Document d = parse(SA::construct_from_utf8("hellomother")); - DOM::Element elem = d.getDocumentElement(); + Arabica::DOM::Document d = parse(SA::construct_from_utf8("hellomother")); + Arabica::DOM::Element elem = d.getDocumentElement(); - DOM::Traversal::DocumentTraversal traversal = d.createDocumentTraversal(); - DOM::Traversal::TreeWalker walker = traversal.createTreeWalker(d.getDocumentElement(), - DOM::Traversal::SHOW_TEXT, + Arabica::DOM::Traversal::DocumentTraversal traversal = d.createDocumentTraversal(); + Arabica::DOM::Traversal::TreeWalker walker = traversal.createTreeWalker(d.getDocumentElement(), + Arabica::DOM::Traversal::SHOW_TEXT, true); assert(walker.getCurrentNode() == elem); assert(walker.nextNode() == elem.getFirstChild().getFirstChild()); @@ -119,12 +119,12 @@ class TreeWalkerTest : public TestCase void test6() { - DOM::Document d = parse(SA::construct_from_utf8("hellomother")); - DOM::Element elem = d.getDocumentElement(); + Arabica::DOM::Document d = parse(SA::construct_from_utf8("hellomother")); + Arabica::DOM::Element elem = d.getDocumentElement(); - DOM::Traversal::DocumentTraversal traversal = d.createDocumentTraversal(); - DOM::Traversal::TreeWalker walker = traversal.createTreeWalker(d.getDocumentElement(), - DOM::Traversal::SHOW_ALL, + Arabica::DOM::Traversal::DocumentTraversal traversal = d.createDocumentTraversal(); + Arabica::DOM::Traversal::TreeWalker walker = traversal.createTreeWalker(d.getDocumentElement(), + Arabica::DOM::Traversal::SHOW_ALL, true); assert(walker.getCurrentNode() == elem); assert(walker.nextNode() == elem.getFirstChild()); @@ -136,12 +136,12 @@ class TreeWalkerTest : public TestCase void test7() { - DOM::Document d = parse(SA::construct_from_utf8("hellomother")); - DOM::Element elem = d.getDocumentElement(); + Arabica::DOM::Document d = parse(SA::construct_from_utf8("hellomother")); + Arabica::DOM::Element elem = d.getDocumentElement(); - DOM::Traversal::DocumentTraversal traversal = d.createDocumentTraversal(); - DOM::Traversal::TreeWalker walker = traversal.createTreeWalker(d.getDocumentElement(), - DOM::Traversal::SHOW_COMMENT, + Arabica::DOM::Traversal::DocumentTraversal traversal = d.createDocumentTraversal(); + Arabica::DOM::Traversal::TreeWalker walker = traversal.createTreeWalker(d.getDocumentElement(), + Arabica::DOM::Traversal::SHOW_COMMENT, true); assert(walker.getCurrentNode() == elem); assert(walker.nextNode() == elem.getLastChild().getFirstChild()); @@ -150,26 +150,26 @@ class TreeWalkerTest : public TestCase void test8() { - DOM::Document d = parse(SA::construct_from_utf8("hellomother")); - DOM::Element elem = d.getDocumentElement(); + Arabica::DOM::Document d = parse(SA::construct_from_utf8("hellomother")); + Arabica::DOM::Element elem = d.getDocumentElement(); - DOM::Traversal::DocumentTraversal traversal = d.createDocumentTraversal(); - DOM::Traversal::TreeWalker walker = traversal.createTreeWalker(d.getDocumentElement(), - DOM::Traversal::SHOW_PROCESSING_INSTRUCTION, + Arabica::DOM::Traversal::DocumentTraversal traversal = d.createDocumentTraversal(); + Arabica::DOM::Traversal::TreeWalker walker = traversal.createTreeWalker(d.getDocumentElement(), + Arabica::DOM::Traversal::SHOW_PROCESSING_INSTRUCTION, true); assert(walker.getCurrentNode() == elem); assert(walker.nextNode() == elem.getLastChild().getLastChild()); assert(walker.nextNode() == 0); } // test8 - class TestFilter : public DOM::Traversal::NodeFilter + class TestFilter : public Arabica::DOM::Traversal::NodeFilter { - typedef DOM::Traversal::NodeFilter base_t; + typedef Arabica::DOM::Traversal::NodeFilter base_t; public: - typedef typename DOM::Traversal::NodeFilter::Result Result; - virtual Result acceptNode(const DOM::Node& node) const + typedef typename Arabica::DOM::Traversal::NodeFilter::Result Result; + virtual Result acceptNode(const Arabica::DOM::Node& node) const { - if(node.getFirstChild().getNodeType() == DOM::Node_base::COMMENT_NODE) + if(node.getFirstChild().getNodeType() == Arabica::DOM::Node_base::COMMENT_NODE) return base_t::FILTER_REJECT; return base_t::FILTER_ACCEPT; } // acceptNode @@ -177,13 +177,13 @@ class TreeWalkerTest : public TestCase void test9() { - DOM::Document d = parse(SA::construct_from_utf8("hellomother")); - DOM::Element elem = d.getDocumentElement(); + Arabica::DOM::Document d = parse(SA::construct_from_utf8("hellomother")); + Arabica::DOM::Element elem = d.getDocumentElement(); - DOM::Traversal::DocumentTraversal traversal = d.createDocumentTraversal(); + Arabica::DOM::Traversal::DocumentTraversal traversal = d.createDocumentTraversal(); TestFilter filter; - DOM::Traversal::TreeWalker walker = traversal.createTreeWalker(d.getDocumentElement(), - DOM::Traversal::SHOW_ELEMENT, + Arabica::DOM::Traversal::TreeWalker walker = traversal.createTreeWalker(d.getDocumentElement(), + Arabica::DOM::Traversal::SHOW_ELEMENT, filter, true); assert(walker.getCurrentNode() == elem); diff --git a/tests/XPath/arithmetic_test.hpp b/tests/XPath/arithmetic_test.hpp index 96ef3cb4..d5f5c68a 100644 --- a/tests/XPath/arithmetic_test.hpp +++ b/tests/XPath/arithmetic_test.hpp @@ -175,7 +175,7 @@ public: } // test14 private: - DOM::Node dummy_; + Arabica::DOM::Node dummy_; }; // ArithmeticTest template diff --git a/tests/XPath/attr_value_test.hpp b/tests/XPath/attr_value_test.hpp index eb256160..32674fe4 100644 --- a/tests/XPath/attr_value_test.hpp +++ b/tests/XPath/attr_value_test.hpp @@ -24,7 +24,7 @@ public: void testParse() { - DOM::Node dummy; + Arabica::DOM::Node dummy; assertTrue(SA::construct_from_utf8("hello") == compileThis("hello")->evaluateAsString(dummy)); assertTrue(SA::construct_from_utf8("") == compileThis("{hello}")->evaluateAsString(dummy)); assertTrue(SA::construct_from_utf8("{hello}") == compileThis("{{hello}}")->evaluateAsString(dummy)); diff --git a/tests/XPath/axis_enumerator_test.hpp b/tests/XPath/axis_enumerator_test.hpp index f11df7c5..a22595de 100644 --- a/tests/XPath/axis_enumerator_test.hpp +++ b/tests/XPath/axis_enumerator_test.hpp @@ -11,22 +11,22 @@ template class AxisEnumeratorTest : public TestCase { - DOM::DOMImplementation factory_; - DOM::Document document_; + Arabica::DOM::DOMImplementation factory_; + Arabica::DOM::Document document_; - DOM::Element root_; + Arabica::DOM::Element root_; - DOM::Element element1_; - DOM::Element element2_; - DOM::Element element3_; + Arabica::DOM::Element element1_; + Arabica::DOM::Element element2_; + Arabica::DOM::Element element3_; - DOM::Attr attr_; + Arabica::DOM::Attr attr_; - DOM::Text text_; + Arabica::DOM::Text text_; - DOM::Comment comment_; + Arabica::DOM::Comment comment_; - DOM::ProcessingInstruction processingInstruction_; + Arabica::DOM::ProcessingInstruction processingInstruction_; public: AxisEnumeratorTest(const std::string& name) : TestCase(name) @@ -35,7 +35,7 @@ public: void setUp() { - factory_ = SimpleDOM::DOMImplementation::getDOMImplementation(); + factory_ = Arabica::SimpleDOM::DOMImplementation::getDOMImplementation(); document_ = factory_.createDocument(string_adaptor::construct_from_utf8(""), string_adaptor::construct_from_utf8("root"), 0); root_ = document_.getDocumentElement(); @@ -67,7 +67,7 @@ public: void childTest1() { - DOM::DocumentFragment node; + Arabica::DOM::DocumentFragment node; Arabica::XPath::AxisEnumerator e(node, Arabica::XPath::CHILD); assertTrue(*e == 0); @@ -76,7 +76,7 @@ public: void childTest2() { - DOM::Node node; + Arabica::DOM::Node node; Arabica::XPath::AxisEnumerator e(node, Arabica::XPath::CHILD); assertTrue(*e == 0); @@ -95,7 +95,7 @@ public: assertTrue(element3_ == *e); assertTrue(string_adaptor::construct_from_utf8("child3") == e->getNodeName()); ++e; - assertTrue(DOM::Node() == *e); + assertTrue(Arabica::DOM::Node() == *e); assertTrue(*e == 0); } // test3 @@ -110,7 +110,7 @@ public: void attributeTest1() { - DOM::DocumentFragment node; + Arabica::DOM::DocumentFragment node; Arabica::XPath::AxisEnumerator e(node, Arabica::XPath::ATTRIBUTE); assertTrue(*e == 0); @@ -119,7 +119,7 @@ public: void attributeTest2() { - DOM::Node node; + Arabica::DOM::Node node; Arabica::XPath::AxisEnumerator e(node, Arabica::XPath::ATTRIBUTE); assertTrue(*e == 0); @@ -170,7 +170,7 @@ public: void followingSiblingTest1() { - DOM::Node node; + Arabica::DOM::Node node; Arabica::XPath::AxisEnumerator e(node, Arabica::XPath::FOLLOWING_SIBLING); assertTrue(*e == 0); assertTrue(e.forward()); @@ -214,7 +214,7 @@ public: void precedingSiblingTest1() { - DOM::Node node; + Arabica::DOM::Node node; Arabica::XPath::AxisEnumerator e(node, Arabica::XPath::PRECEDING_SIBLING); assertTrue(*e == 0); assertTrue(e.reverse()); @@ -275,7 +275,7 @@ public: void selfTest3() { - DOM::Node node; + Arabica::DOM::Node node; Arabica::XPath::AxisEnumerator e(node, Arabica::XPath::SELF); assertTrue(*e == 0); } // selfTest3 @@ -686,8 +686,8 @@ public: void namespaceNodeTest1() { using namespace Arabica::XPath; - DOM::Node node(new impl::NamespaceNodeImpl(string_adaptor::construct_from_utf8("p"), string_adaptor::construct_from_utf8("test-uri"))); - DOM::Node node2; + Arabica::DOM::Node node(new impl::NamespaceNodeImpl(string_adaptor::construct_from_utf8("p"), string_adaptor::construct_from_utf8("test-uri"))); + Arabica::DOM::Node node2; node2 = node; } // namespaceNodeTest1 @@ -695,9 +695,9 @@ public: void namespaceNodeTest2() { using namespace Arabica::XPath; - DOM::Node node; + Arabica::DOM::Node node; { - DOM::Node node2(new impl::NamespaceNodeImpl(string_adaptor::construct_from_utf8("p"), string_adaptor::construct_from_utf8("test-uri"))); + Arabica::DOM::Node node2(new impl::NamespaceNodeImpl(string_adaptor::construct_from_utf8("p"), string_adaptor::construct_from_utf8("test-uri"))); node = node2; } } // namespaceNodeTest2 @@ -705,9 +705,9 @@ public: void namespaceNodeTest3() { using namespace Arabica::XPath; - DOM::Node node; + Arabica::DOM::Node node; { - DOM::Node node2(new impl::NamespaceNodeImpl(string_adaptor::construct_from_utf8("p"), string_adaptor::construct_from_utf8("test-uri"))); + Arabica::DOM::Node node2(new impl::NamespaceNodeImpl(string_adaptor::construct_from_utf8("p"), string_adaptor::construct_from_utf8("test-uri"))); node = node2; } node = 0; @@ -716,7 +716,7 @@ public: void namespaceNodeTest4() { using namespace Arabica::XPath; - DOM::Node node(new impl::NamespaceNodeImpl(string_adaptor::construct_from_utf8("p"), string_adaptor::construct_from_utf8("test-uri"))); + Arabica::DOM::Node node(new impl::NamespaceNodeImpl(string_adaptor::construct_from_utf8("p"), string_adaptor::construct_from_utf8("test-uri"))); assertTrue(string_adaptor::construct_from_utf8("p") == node.getLocalName()); assertTrue(string_adaptor::construct_from_utf8("test-uri") == node.getNodeValue()); assertTrue(string_adaptor::construct_from_utf8("") == node.getNamespaceURI()); @@ -727,7 +727,7 @@ public: { Arabica::XPath::AxisEnumerator e(root_, Arabica::XPath::NAMESPACE); assertTrue(*e != 0); - DOM::Node ns = *e; + Arabica::DOM::Node ns = *e; assertTrue(string_adaptor::construct_from_utf8("xml") == ns.getLocalName()); assertTrue(string_adaptor::construct_from_utf8("http://www.w3.org/XML/1998/namespace") == ns.getNodeValue()); ++e; @@ -741,7 +741,7 @@ public: string_adaptor::construct_from_utf8("urn:test")); Arabica::XPath::AxisEnumerator e(root_, Arabica::XPath::NAMESPACE); assertTrue(*e != 0); - DOM::Node ns = *e; + Arabica::DOM::Node ns = *e; assertTrue(string_adaptor::construct_from_utf8("xml") == ns.getLocalName()); ++e; assertTrue(*e != 0); diff --git a/tests/XPath/execute_test.hpp b/tests/XPath/execute_test.hpp index b60238b3..e32cf56b 100644 --- a/tests/XPath/execute_test.hpp +++ b/tests/XPath/execute_test.hpp @@ -65,7 +65,7 @@ public: TestFunction(const std::vector >& args) : Arabica::XPath::XPathFunction(0, 0, args) { } - virtual Arabica::XPath::XPathValue* evaluate(const DOM::Node& context, + virtual Arabica::XPath::XPathValue* evaluate(const Arabica::DOM::Node& context, const Arabica::XPath::ExecutionContext& executionContext) const { string_type name = string_adaptor::construct_from_utf8("test-"); @@ -94,27 +94,27 @@ template class ExecuteTest : public TestCase { Arabica::XPath::XPath parser; - DOM::DOMImplementation factory_; - DOM::Document document_; + Arabica::DOM::DOMImplementation factory_; + Arabica::DOM::Document document_; - DOM::Element root_; + Arabica::DOM::Element root_; - DOM::Element element1_; - DOM::Element element2_; - DOM::Element element3_; - DOM::Element spinkle_; + Arabica::DOM::Element element1_; + Arabica::DOM::Element element2_; + Arabica::DOM::Element element3_; + Arabica::DOM::Element spinkle_; - DOM::Attr attr_; + Arabica::DOM::Attr attr_; - DOM::Text text_; + Arabica::DOM::Text text_; - DOM::Comment comment_; + Arabica::DOM::Comment comment_; - DOM::ProcessingInstruction processingInstruction_; + Arabica::DOM::ProcessingInstruction processingInstruction_; - DOM::Document chapters_; + Arabica::DOM::Document chapters_; - DOM::Document numbers_; + Arabica::DOM::Document numbers_; typedef string_adaptor SA; public: @@ -124,7 +124,7 @@ public: void setUp() { - factory_ = SimpleDOM::DOMImplementation::getDOMImplementation(); + factory_ = Arabica::SimpleDOM::DOMImplementation::getDOMImplementation(); document_ = factory_.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8("root"), 0); root_ = document_.getDocumentElement(); @@ -182,7 +182,7 @@ public: assertValuesEqual(NODE_SET, result->type()); assertValuesEqual(1, result->asNodeSet().size()); - DOM::Node n = result->asNodeSet()[0]; + Arabica::DOM::Node n = result->asNodeSet()[0]; assertTrue(root_ == n); } // test1 @@ -194,7 +194,7 @@ public: assertValuesEqual(NODE_SET, result->type()); assertValuesEqual(1, result->asNodeSet().size()); - DOM::Node n = result->asNodeSet()[0]; + Arabica::DOM::Node n = result->asNodeSet()[0]; assertTrue(element2_ == n); } // test2 @@ -341,7 +341,7 @@ public: assertValuesEqual(NODE_SET, result->type()); assertValuesEqual(1, result->asNodeSet().size()); - DOM::Node n = result->asNodeSet()[0]; + Arabica::DOM::Node n = result->asNodeSet()[0]; assertTrue(element2_ == n); } // test12 @@ -414,7 +414,7 @@ public: assertValuesEqual(NODE_SET, result->type()); assertValuesEqual(1, result->asNodeSet().size()); - DOM::Node n = result->asNodeSet()[0]; + Arabica::DOM::Node n = result->asNodeSet()[0]; assertTrue(element2_ == n); } // test19 @@ -651,10 +651,10 @@ public: void test42() { using namespace Arabica::XPath; - DOM::Element f1 = chapters_.createElement(SA::construct_from_utf8("footer")); - DOM::Element f2 = chapters_.createElement(SA::construct_from_utf8("footer")); + Arabica::DOM::Element f1 = chapters_.createElement(SA::construct_from_utf8("footer")); + Arabica::DOM::Element f2 = chapters_.createElement(SA::construct_from_utf8("footer")); XPathValuePtr ch = parser.evaluate(SA::construct_from_utf8("/document/chapter"), chapters_); - DOM::Node n = ch->asNodeSet()[0]; + Arabica::DOM::Node n = ch->asNodeSet()[0]; n.appendChild(f1); n = ch->asNodeSet()[1]; n.appendChild(f2); @@ -799,7 +799,7 @@ public: void testUnion11() { using namespace Arabica::XPath; - DOM::DocumentFragment frag = document_.createDocumentFragment(); + Arabica::DOM::DocumentFragment frag = document_.createDocumentFragment(); frag.appendChild(document_.createElement(SA::construct_from_utf8("foo"))); NodeSetVariableResolver svr; @@ -817,9 +817,9 @@ public: void testUnion12() { using namespace Arabica::XPath; - DOM::DocumentFragment frag = document_.createDocumentFragment(); - DOM::Node n1 = document_.createElement(SA::construct_from_utf8("foo")); - DOM::Node n2 = document_.createElement(SA::construct_from_utf8("bar")); + Arabica::DOM::DocumentFragment frag = document_.createDocumentFragment(); + Arabica::DOM::Node n1 = document_.createElement(SA::construct_from_utf8("foo")); + Arabica::DOM::Node n2 = document_.createElement(SA::construct_from_utf8("bar")); frag.appendChild(n1); frag.appendChild(n2); diff --git a/tests/XPath/expression_test.hpp b/tests/XPath/expression_test.hpp index d4fea9a9..baf5181e 100644 --- a/tests/XPath/expression_test.hpp +++ b/tests/XPath/expression_test.hpp @@ -13,27 +13,27 @@ template class ExpressionTest : public TestCase { Arabica::XPath::XPath parser; - DOM::DOMImplementation factory_; - DOM::Document document_; + Arabica::DOM::DOMImplementation factory_; + Arabica::DOM::Document document_; - DOM::Element root_; + Arabica::DOM::Element root_; - DOM::Element element1_; - DOM::Element element2_; - DOM::Element element3_; - DOM::Element spinkle_; + Arabica::DOM::Element element1_; + Arabica::DOM::Element element2_; + Arabica::DOM::Element element3_; + Arabica::DOM::Element spinkle_; - DOM::Attr attr_; + Arabica::DOM::Attr attr_; - DOM::Text text_; + Arabica::DOM::Text text_; - DOM::Comment comment_; + Arabica::DOM::Comment comment_; - DOM::ProcessingInstruction processingInstruction_; + Arabica::DOM::ProcessingInstruction processingInstruction_; - DOM::Document chapters_; + Arabica::DOM::Document chapters_; - DOM::Document numbers_; + Arabica::DOM::Document numbers_; typedef string_adaptor SA; public: @@ -43,7 +43,7 @@ public: void setUp() { - factory_ = SimpleDOM::DOMImplementation::getDOMImplementation(); + factory_ = Arabica::SimpleDOM::DOMImplementation::getDOMImplementation(); document_ = factory_.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8("root"), 0); root_ = document_.getDocumentElement(); diff --git a/tests/XPath/logical_test.hpp b/tests/XPath/logical_test.hpp index 17ddaf23..571975c7 100644 --- a/tests/XPath/logical_test.hpp +++ b/tests/XPath/logical_test.hpp @@ -76,7 +76,7 @@ public: } // test8 private: - DOM::Node dummy_; + Arabica::DOM::Node dummy_; }; // class LogicalTest template diff --git a/tests/XPath/match_test.hpp b/tests/XPath/match_test.hpp index 983ef66c..813c4469 100644 --- a/tests/XPath/match_test.hpp +++ b/tests/XPath/match_test.hpp @@ -100,7 +100,7 @@ public: void testEvaluateDocMatch() { - DOM::Document doc = parseXML("hello"); + Arabica::DOM::Document doc = parseXML("hello"); assertTrue(applyMatch("/", doc)); @@ -111,7 +111,7 @@ public: void testDocElementMatch() { - DOM::Document doc = parseXML("hello"); + Arabica::DOM::Document doc = parseXML("hello"); assertTrue(applyMatch("doc", doc.getFirstChild())); assertTrue(applyMatch("doc[para]", doc.getFirstChild())); @@ -135,7 +135,7 @@ public: void testDocElementNotMatch() { - DOM::Document doc = parseXML("hello"); + Arabica::DOM::Document doc = parseXML("hello"); assertFalse(applyMatch("para", doc.getFirstChild())); assertFalse(applyMatch("@*", doc.getFirstChild())); @@ -152,9 +152,9 @@ public: void testAttributeMatch() { - DOM::Document doc = parseXML("hello"); - DOM::Node a1 = doc.getFirstChild().getFirstChild().getAttributes().getNamedItem(SA::construct_from_utf8("id")); - DOM::Node a2 = doc.getFirstChild().getFirstChild().getAttributes().getNamedItem(SA::construct_from_utf8("name")); + Arabica::DOM::Document doc = parseXML("hello"); + Arabica::DOM::Node a1 = doc.getFirstChild().getFirstChild().getAttributes().getNamedItem(SA::construct_from_utf8("id")); + Arabica::DOM::Node a2 = doc.getFirstChild().getFirstChild().getAttributes().getNamedItem(SA::construct_from_utf8("name")); assertTrue(applyMatch("@id", a1)); assertTrue(applyMatch("@*", a1)); @@ -184,8 +184,8 @@ public: void testCommentMatch() { - DOM::Document doc = parseXML("hello"); - DOM::Node comment = doc.getFirstChild().getLastChild(); + Arabica::DOM::Document doc = parseXML("hello"); + Arabica::DOM::Node comment = doc.getFirstChild().getLastChild(); assertFalse(applyMatch("comment()", doc)); assertFalse(applyMatch("comment()", doc.getFirstChild())); @@ -195,8 +195,8 @@ public: void testProcessingInstructionMatch() { - DOM::Document doc = parseXML("hello"); - DOM::Node pi = doc.getFirstChild().getLastChild(); + Arabica::DOM::Document doc = parseXML("hello"); + Arabica::DOM::Node pi = doc.getFirstChild().getLastChild(); assertFalse(applyMatch("processing-instruction()", doc)); assertFalse(applyMatch("processing-instruction()", doc.getFirstChild())); @@ -220,7 +220,7 @@ public: nsContext.addNamespaceDeclaration(SA::construct_from_utf8("bang"), SA::construct_from_utf8("bang")); parser.setNamespaceContext(nsContext); - DOM::Document doc = parseXML("hello"); + Arabica::DOM::Document doc = parseXML("hello"); assertFalse(applyMatch("bang:*", doc)); assertTrue(applyMatch("bang:*", doc.getFirstChild())); @@ -385,7 +385,7 @@ public: return matches; } // compileMatches - bool applyMatches(const char* match, const DOM::Node& node) + bool applyMatches(const char* match, const Arabica::DOM::Node& node) { compileMatches(match); for(unsigned int i = 0; i < matches.size(); ++i) @@ -394,19 +394,19 @@ public: return false; } // applyMatches - bool applyMatch(const char* match, const DOM::Node& node) + bool applyMatch(const char* match, const Arabica::DOM::Node& node) { return compileMatch(match)->evaluateAsBool(node); } // applyMatch - DOM::Document parseXML(const char* match) + Arabica::DOM::Document parseXML(const char* match) { std::stringstream ss; ss << match; Arabica::SAX::basic_InputSource is(ss); Arabica::SAX::CatchErrorHandler eh; - SAX2DOM::Parser parser; + Arabica::SAX2DOM::Parser parser; parser.setErrorHandler(eh); parser.parse(is); diff --git a/tests/XPath/node_test_test.hpp b/tests/XPath/node_test_test.hpp index a8d1c3af..7fb455d5 100644 --- a/tests/XPath/node_test_test.hpp +++ b/tests/XPath/node_test_test.hpp @@ -11,22 +11,22 @@ template class NodeTestTest : public TestCase { - DOM::DOMImplementation factory_; - DOM::Document document_; + Arabica::DOM::DOMImplementation factory_; + Arabica::DOM::Document document_; - DOM::Element root_; + Arabica::DOM::Element root_; - DOM::Element element1_; - DOM::Element element2_; - DOM::Element element3_; + Arabica::DOM::Element element1_; + Arabica::DOM::Element element2_; + Arabica::DOM::Element element3_; - DOM::Attr attr_; + Arabica::DOM::Attr attr_; - DOM::Text text_; + Arabica::DOM::Text text_; - DOM::Comment comment_; + Arabica::DOM::Comment comment_; - DOM::ProcessingInstruction processingInstruction_; + Arabica::DOM::ProcessingInstruction processingInstruction_; typedef string_adaptor SA; @@ -37,7 +37,7 @@ public: void setUp() { - factory_ = SimpleDOM::DOMImplementation::getDOMImplementation(); + factory_ = Arabica::SimpleDOM::DOMImplementation::getDOMImplementation(); document_ = factory_.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8("root"), 0); root_ = document_.getDocumentElement(); @@ -218,17 +218,17 @@ public: impl::QNameNodeTest test(SA::construct_from_utf8("http://example.com/test"), SA::construct_from_utf8("one")); - DOM::Element e1_ = document_.createElementNS(SA::construct_from_utf8("http://example.com/test"), + Arabica::DOM::Element e1_ = document_.createElementNS(SA::construct_from_utf8("http://example.com/test"), SA::construct_from_utf8("ns:one")); - DOM::Element e2_ = document_.createElementNS(SA::construct_from_utf8("http://example.com/test"), + Arabica::DOM::Element e2_ = document_.createElementNS(SA::construct_from_utf8("http://example.com/test"), SA::construct_from_utf8("ttt:one")); - DOM::Element e3_ = document_.createElementNS(SA::construct_from_utf8("http://example.com/test"), + Arabica::DOM::Element e3_ = document_.createElementNS(SA::construct_from_utf8("http://example.com/test"), SA::construct_from_utf8("ns:two")); - DOM::Element e4_ = document_.createElementNS(SA::construct_from_utf8("http://example.com/test"), + Arabica::DOM::Element e4_ = document_.createElementNS(SA::construct_from_utf8("http://example.com/test"), SA::construct_from_utf8("ttt:two")); - DOM::Element e5_ = document_.createElementNS(SA::construct_from_utf8("http://example.com/ssss"), + Arabica::DOM::Element e5_ = document_.createElementNS(SA::construct_from_utf8("http://example.com/ssss"), SA::construct_from_utf8("ns:one")); - DOM::Element e6_ = document_.createElementNS(SA::construct_from_utf8("http://example.com/eeee"), + Arabica::DOM::Element e6_ = document_.createElementNS(SA::construct_from_utf8("http://example.com/eeee"), SA::construct_from_utf8("ttt:one")); assertTrue(test(e1_)); @@ -244,12 +244,12 @@ public: using namespace Arabica::XPath; impl::QStarNodeTest test(SA::construct_from_utf8("http://example.com/test")); - DOM::Element e1_ = document_.createElementNS(SA::construct_from_utf8("http://example.com/test"), SA::construct_from_utf8("ns:one")); - DOM::Element e2_ = document_.createElementNS(SA::construct_from_utf8("http://example.com/test"), SA::construct_from_utf8("ttt:one")); - DOM::Element e3_ = document_.createElementNS(SA::construct_from_utf8("http://example.com/test"), SA::construct_from_utf8("ns:two")); - DOM::Element e4_ = document_.createElementNS(SA::construct_from_utf8("http://example.com/test"), SA::construct_from_utf8("ttt:two")); - DOM::Element e5_ = document_.createElementNS(SA::construct_from_utf8("http://example.com/ssss"), SA::construct_from_utf8("ns:one")); - DOM::Element e6_ = document_.createElementNS(SA::construct_from_utf8("http://example.com/eeee"), SA::construct_from_utf8("ttt:one")); + Arabica::DOM::Element e1_ = document_.createElementNS(SA::construct_from_utf8("http://example.com/test"), SA::construct_from_utf8("ns:one")); + Arabica::DOM::Element e2_ = document_.createElementNS(SA::construct_from_utf8("http://example.com/test"), SA::construct_from_utf8("ttt:one")); + Arabica::DOM::Element e3_ = document_.createElementNS(SA::construct_from_utf8("http://example.com/test"), SA::construct_from_utf8("ns:two")); + Arabica::DOM::Element e4_ = document_.createElementNS(SA::construct_from_utf8("http://example.com/test"), SA::construct_from_utf8("ttt:two")); + Arabica::DOM::Element e5_ = document_.createElementNS(SA::construct_from_utf8("http://example.com/ssss"), SA::construct_from_utf8("ns:one")); + Arabica::DOM::Element e6_ = document_.createElementNS(SA::construct_from_utf8("http://example.com/eeee"), SA::construct_from_utf8("ttt:one")); assertTrue(test(e1_)); assertTrue(test(e2_)); diff --git a/tests/XPath/relational_test.hpp b/tests/XPath/relational_test.hpp index 30555861..655d2968 100644 --- a/tests/XPath/relational_test.hpp +++ b/tests/XPath/relational_test.hpp @@ -174,7 +174,7 @@ public: } // testLessThanEquals3 private: - DOM::Node dummy_; + Arabica::DOM::Node dummy_; }; // class RelationalTest template diff --git a/tests/XPath/step_test.hpp b/tests/XPath/step_test.hpp index 476b75e6..ac8d9cf6 100644 --- a/tests/XPath/step_test.hpp +++ b/tests/XPath/step_test.hpp @@ -13,16 +13,16 @@ class StepTest : public TestCase { typedef string_adaptor SA; - DOM::DOMImplementation factory_; - DOM::Document document_; + Arabica::DOM::DOMImplementation factory_; + Arabica::DOM::Document document_; - DOM::Element root_; + Arabica::DOM::Element root_; - DOM::Element element1_; - DOM::Element element2_; - DOM::Element element3_; + Arabica::DOM::Element element1_; + Arabica::DOM::Element element2_; + Arabica::DOM::Element element3_; - DOM::Attr attr_; + Arabica::DOM::Attr attr_; public: StepTest(const std::string& name) : TestCase(name) @@ -31,7 +31,7 @@ public: void setUp() { - factory_ = SimpleDOM::DOMImplementation::getDOMImplementation(); + factory_ = Arabica::SimpleDOM::DOMImplementation::getDOMImplementation(); document_ = factory_.createDocument(SA::construct_from_utf8(""), SA::construct_from_utf8("root"), 0); root_ = document_.getDocumentElement(); @@ -75,13 +75,13 @@ public: NodeSet set = step->evaluateAsNodeSet(element2_); assertEquals(4, set.size()); - DOM::Attr attr = static_cast >(set[0]); + Arabica::DOM::Attr attr = static_cast >(set[0]); assertTrue(attr.getNodeName() == SA::construct_from_utf8("one")); - attr = static_cast >(set[1]); + attr = static_cast >(set[1]); assertTrue(attr.getNodeName() == SA::construct_from_utf8("two")); - attr = static_cast >(set[2]); + attr = static_cast >(set[2]); assertTrue(attr.getNodeName() == SA::construct_from_utf8("three")); - attr = static_cast >(set[3]); + attr = static_cast >(set[3]); assertTrue(attr.getNodeName() == SA::construct_from_utf8("four")); } // test2 diff --git a/tests/XPath/value_test.hpp b/tests/XPath/value_test.hpp index f9eaa6df..0eda9258 100644 --- a/tests/XPath/value_test.hpp +++ b/tests/XPath/value_test.hpp @@ -11,7 +11,7 @@ template class ValueTest : public TestCase { private: - DOM::Node dummy_; + Arabica::DOM::Node dummy_; typedef string_adaptor SA; public: diff --git a/tests/XSLT/xslt_test.hpp b/tests/XSLT/xslt_test.hpp index 4551cba0..ea0574cb 100644 --- a/tests/XSLT/xslt_test.hpp +++ b/tests/XSLT/xslt_test.hpp @@ -16,30 +16,30 @@ const std::string PATH_PREFIX=test_path; const std::string SEPERATOR = "/"; #endif -DOM::Document buildDOM(const std::string& filename) +Arabica::DOM::Document buildDOM(const std::string& filename) { Arabica::SAX::InputSource is(filename); - SAX2DOM::Parser parser; + Arabica::SAX2DOM::Parser parser; parser.parse(is); - DOM::Document d = parser.getDocument(); + Arabica::DOM::Document d = parser.getDocument(); if(d != 0) d.normalize(); return d; } // buildDOM -Arabica::XPath::NodeSet selectNodes(const std::string& path, const DOM::Node& node) +Arabica::XPath::NodeSet selectNodes(const std::string& path, const Arabica::DOM::Node& node) { Arabica::XPath::XPath xpath; return xpath.evaluate(path, node)->asNodeSet(); } // selectNodes -DOM::Node selectNode(const std::string& path, const DOM::Node& node) +Arabica::DOM::Node selectNode(const std::string& path, const Arabica::DOM::Node& node) { return selectNodes(path, node)[0]; } // selectNode -std::string selectString(const std::string& path, const DOM::Node& node) +std::string selectString(const std::string& path, const Arabica::DOM::Node& node) { Arabica::XPath::XPath xpath; return xpath.evaluate_expr(path, node)->asString(); @@ -124,7 +124,7 @@ protected: std::ostringstream errors; stylesheet->set_error_output(errors); - DOM::Document document = buildDOM(input_xml_); + Arabica::DOM::Document document = buildDOM(input_xml_); try { stylesheet->execute(document); } @@ -169,7 +169,7 @@ protected: std::ostringstream errors; stylesheet->set_error_output(errors); - DOM::Document document = buildDOM(input_xml_); + Arabica::DOM::Document document = buildDOM(input_xml_); try { stylesheet->execute(document); } @@ -177,10 +177,10 @@ protected: assertImplementation(false, "Failed to run " + input_xslt_ + " : " + e.what()); } - DOM::Document ref = buildDOM(output_xml_); + Arabica::DOM::Document ref = buildDOM(output_xml_); if(ref == 0) assertImplementation(false, "Couldn't read " + output_xml_ + ". Perhaps it isn't well-formed XML?"); - DOM::Node out = output.node(); + Arabica::DOM::Node out = output.node(); std::string refs = docToString(ref.getFirstChild()); std::string outs = docToString(out.getFirstChild()); @@ -196,19 +196,19 @@ protected: } } // runTest - std::string docToString(DOM::Node node) + std::string docToString(Arabica::DOM::Node node) { std::ostringstream ss; ss << node; return Arabica::string::normalize_whitespace >(ss.str()); } // docToString - void stripWhitespace(DOM::Node doc) + void stripWhitespace(Arabica::DOM::Node doc) { Arabica::XPath::NodeSet textNodes = selectNodes("//text()", doc); for(int i = 0; i != textNodes.size(); ++i) { - DOM::Node t = textNodes[i]; + Arabica::DOM::Node t = textNodes[i]; std::string text = t.getNodeValue(); size_t index = text.find_first_of(" \n"); while(index != std::string::npos) @@ -230,7 +230,7 @@ class Expected public: Expected() { - DOM::Document fail_doc = buildDOM(PATH_PREFIX + "arabica-expected-fails.xml"); + Arabica::DOM::Document fail_doc = buildDOM(PATH_PREFIX + "arabica-expected-fails.xml"); Arabica::XPath::NodeSet failcases = selectNodes("/test-suite/test-case", fail_doc); for(int i = 0; i != failcases.size(); ++i) { @@ -264,7 +264,7 @@ static Expected expected; TestSuite* XSLTTest_suite(const std::string& path) { - static DOM::Document catalog = buildDOM(PATH_PREFIX + "catalog.xml"); + static Arabica::DOM::Document catalog = buildDOM(PATH_PREFIX + "catalog.xml"); TestSuite *suiteOfTests = new TestSuite;