moved SAX:: into Arabica::SAX::

This commit is contained in:
jez 2007-09-05 09:49:18 +00:00
parent c07fc40920
commit a6c116acd6
74 changed files with 311 additions and 128 deletions

View file

@ -21,13 +21,13 @@ int main(int argc, char* argv[])
{ // narrow
SAX2DOM::Parser<std::string> domParser;
SAX::CatchErrorHandler<std::string> eh;
Arabica::SAX::CatchErrorHandler<std::string> eh;
domParser.setErrorHandler(eh);
for(int i = 1; i < argc; ++i)
{
std::string file(argv[i]);
SAX::InputSource is;
Arabica::SAX::InputSource is;
is.setSystemId(file);
if(file != "-")
@ -59,7 +59,7 @@ int main(int argc, char* argv[])
{ // wide
SAX2DOM::Parser<std::wstring> domParser;
SAX::wInputSource is;
Arabica::SAX::wInputSource is;
is.setSystemId(L"stdin");
is.setByteStream(std::cin);

View file

@ -7,9 +7,9 @@
//////////////////////////////////////////////
// EntityResolver
SAX::InputSource SimpleHandler::resolveEntity(const std::string& publicId, const std::string& systemId)
Arabica::SAX::InputSource SimpleHandler::resolveEntity(const std::string& publicId, const std::string& systemId)
{
return SAX::InputSource();
return Arabica::SAX::InputSource();
} // resolveEntity
//////////////////////////////////////////////
@ -57,7 +57,7 @@ void SimpleHandler::endPrefixMapping(const std::string& prefix)
} // startPrefixMapping
void SimpleHandler::startElement(const std::string& namespaceURI, const std::string& localName,
const std::string& qName, const SAX::Attributes& atts)
const std::string& qName, const Arabica::SAX::Attributes& atts)
{
if(localName.length())
std::cout << "Start Element: " << namespaceURI << ":" << localName << std::endl;
@ -93,17 +93,17 @@ void SimpleHandler::skippedEntity(const std::string& name)
/////////////////////////////////////////////////////
// ErrorHandler
void SimpleHandler::warning(const SAX::SAXParseException& exception)
void SimpleHandler::warning(const Arabica::SAX::SAXParseException& exception)
{
std::cerr << "WARNING: " << exception.what() << std::endl;
} // warning
void SimpleHandler::error(const SAX::SAXParseException& exception)
void SimpleHandler::error(const Arabica::SAX::SAXParseException& exception)
{
std::cerr << "ERROR : " << exception.what() << std::endl;
} // error
void SimpleHandler::fatalError(const SAX::SAXParseException& exception)
void SimpleHandler::fatalError(const Arabica::SAX::SAXParseException& exception)
{
std::cerr << "FATAL : " << exception.what() << std::endl;
} // fatalError

View file

@ -13,12 +13,12 @@
#include <SAX/ext/DeclHandler.hpp>
#include <SAX/SAXException.hpp>
class SimpleHandler : public SAX::EntityResolver,
public SAX::DTDHandler,
public SAX::ContentHandler,
public SAX::ErrorHandler,
public SAX::LexicalHandler,
public SAX::DeclHandler
class SimpleHandler : public Arabica::SAX::EntityResolver,
public Arabica::SAX::DTDHandler,
public Arabica::SAX::ContentHandler,
public Arabica::SAX::ErrorHandler,
public Arabica::SAX::LexicalHandler,
public Arabica::SAX::DeclHandler
{
public:
SimpleHandler() { }
@ -26,7 +26,7 @@ public:
//////////////////////////////////////////////
// EntityResolver
virtual SAX::InputSource resolveEntity(const std::string& publicId, const std::string& systemId);
virtual Arabica::SAX::InputSource resolveEntity(const std::string& publicId, const std::string& systemId);
//////////////////////////////////////////////
// DTDHandler
@ -56,9 +56,9 @@ public:
/////////////////////////////////////////////////////
// ErrorHandler
virtual void warning(const SAX::SAXParseException&);
virtual void error(const SAX::SAXParseException&);
virtual void fatalError(const SAX::SAXParseException& exception);
virtual void warning(const Arabica::SAX::SAXParseException&);
virtual void error(const Arabica::SAX::SAXParseException&);
virtual void fatalError(const Arabica::SAX::SAXParseException& exception);
///////////////////////////////////////////////////////
// LexicalHandler

View file

@ -19,18 +19,18 @@
#include <SAX/XMLReader.hpp>
#include <iostream>
class SAX2PYX : public SAX::DefaultHandler
class SAX2PYX : public Arabica::SAX::DefaultHandler
{
public:
virtual void startElement(const std::string& namespaceURI, const std::string& localName,
const std::string& qName, const SAX::Attributes& atts);
const std::string& qName, const Arabica::SAX::Attributes& atts);
virtual void endElement(const std::string& namespaceURI, const std::string& localName,
const std::string& qName);
virtual void characters(const std::string& ch);
virtual void processingInstruction(const std::string& target, const std::string& data);
virtual void warning(const SAX::SAXParseException& e) { fatalError(e); }
virtual void error(const SAX::SAXParseException& e) { fatalError(e); }
virtual void warning(const Arabica::SAX::SAXParseException& e) { fatalError(e); }
virtual void error(const Arabica::SAX::SAXParseException& e) { fatalError(e); }
private:
std::string escape(const std::string& str) const;
@ -50,12 +50,12 @@ int main(int argc, char* argv[])
{
try
{
SAX::XMLReader<std::string> myParser;
Arabica::SAX::XMLReader<std::string> myParser;
myParser.setContentHandler(handler);
myParser.setErrorHandler(handler);
myParser.setFeature("prohibit-dtd", false);
SAX::InputSource is(argv[i]);
Arabica::SAX::InputSource is(argv[i]);
myParser.parse(is);
} // try
catch(std::runtime_error& e)
@ -69,7 +69,7 @@ int main(int argc, char* argv[])
void SAX2PYX::startElement(const std::string&, const std::string& localName,
const std::string&, const SAX::Attributes& atts)
const std::string&, const Arabica::SAX::Attributes& atts)
{
std::cout << '(' << localName << std::endl;

View file

@ -19,12 +19,12 @@ int main(int argc, char* argv[])
} // if(argc == 0)
SimpleHandler myHandler;
SAX::FeatureNames<std::string> fNames;
SAX::PropertyNames<std::string> pNames;
Arabica::SAX::FeatureNames<std::string> fNames;
Arabica::SAX::PropertyNames<std::string> pNames;
for(int i = 1; i < argc; ++i)
{
SAX::XMLReader<std::string> parser;
Arabica::SAX::XMLReader<std::string> parser;
try
{
@ -33,7 +33,7 @@ int main(int argc, char* argv[])
parser.setFeature(fNames.namespaces, true);
parser.setFeature(fNames.namespace_prefixes, true);
}
catch(SAX::SAXException& e)
catch(Arabica::SAX::SAXException& e)
{
std::cerr << e.what() << std::endl;
}
@ -49,12 +49,12 @@ int main(int argc, char* argv[])
if(file != "-")
{
SAX::InputSource is(file);
Arabica::SAX::InputSource is(file);
parser.parse(is);
}
else
{
SAX::InputSource is;
Arabica::SAX::InputSource is;
is.setSystemId("stdin");
is.setByteStream(std::cin);

View file

@ -19,10 +19,10 @@ int main(int argc, char* argv[])
} // if(argc < 2)
{ // narrow
SAX::FeatureNames<std::string> fNames;
SAX::XMLReader<std::string> parser;
SAX::Writer writer(std::cout, 4);
SAX::CatchErrorHandler<std::string> eh;
Arabica::SAX::FeatureNames<std::string> fNames;
Arabica::SAX::XMLReader<std::string> parser;
Arabica::SAX::Writer writer(std::cout, 4);
Arabica::SAX::CatchErrorHandler<std::string> eh;
writer.setParent(parser);
writer.setErrorHandler(eh);
@ -30,7 +30,7 @@ int main(int argc, char* argv[])
for(int i = 1; i < argc; ++i)
{
std::string file(argv[i]);
SAX::InputSource is;
Arabica::SAX::InputSource is;
is.setSystemId(file);
if(file != "-")

View file

@ -18,19 +18,19 @@
#include <SAX/helpers/XMLBaseSupport.hpp>
#include <iostream>
class hrefPrinter : public SAX::DefaultHandler
class hrefPrinter : public Arabica::SAX::DefaultHandler
{
public:
virtual void startElement(const std::string& namespaceURI, const std::string& localName,
const std::string& qName, const SAX::Attributes& atts);
const std::string& qName, const Arabica::SAX::Attributes& atts);
virtual void endElement(const std::string& namespaceURI, const std::string& localName,
const std::string& qName);
virtual void warning(const SAX::SAXParseException& e) { fatalError(e); }
virtual void error(const SAX::SAXParseException& e) { fatalError(e); }
virtual void warning(const Arabica::SAX::SAXParseException& e) { fatalError(e); }
virtual void error(const Arabica::SAX::SAXParseException& e) { fatalError(e); }
private:
SAX::XMLBaseSupport xmlbaseTracker_;
Arabica::SAX::XMLBaseSupport xmlbaseTracker_;
}; // class SimpleHandler
int main(int argc, char* argv[])
@ -47,11 +47,11 @@ int main(int argc, char* argv[])
{
try
{
SAX::XMLReader<std::string> myParser;
Arabica::SAX::XMLReader<std::string> myParser;
myParser.setContentHandler(handler);
myParser.setErrorHandler(handler);
SAX::InputSource is(argv[i]);
Arabica::SAX::InputSource is(argv[i]);
myParser.parse(is);
} // try
catch(std::runtime_error& e)
@ -65,7 +65,7 @@ int main(int argc, char* argv[])
void hrefPrinter::startElement(const std::string&, const std::string& localName,
const std::string&, const SAX::Attributes& atts)
const std::string&, const Arabica::SAX::Attributes& atts)
{
xmlbaseTracker_.startElement(atts);

View file

@ -33,13 +33,13 @@ int main(int argc, char* argv[])
SAX2DOM::Parser<std::string> domParser;
SAX::CatchErrorHandler<std::string> eh;
Arabica::SAX::CatchErrorHandler<std::string> eh;
domParser.setErrorHandler(eh);
for(int i = 2; i < argc; ++i)
{
std::string file(argv[i]);
SAX::InputSource is;
Arabica::SAX::InputSource is;
is.setSystemId(file);
if(file != "-")

View file

@ -33,7 +33,7 @@ int main(int argc, const char* argv[])
std::ostringstream errors;
try
{
SAX::InputSource source(argv[2]);
Arabica::SAX::InputSource source(argv[2]);
std::auto_ptr<Arabica::XSLT::Stylesheet> stylesheet = compiler.compile(source);
if(stylesheet.get() == 0)
{
@ -64,7 +64,7 @@ int main(int argc, const char* argv[])
DOM::Document<std::string> buildDOM(const std::string& filename)
{
SAX::InputSource is(filename);
Arabica::SAX::InputSource is(filename);
SAX2DOM::Parser<std::string> parser;
parser.parse(is);

View file

@ -8,7 +8,7 @@ namespace DualMode
{
template<class stringT,
class string_adaptorT = Arabica::default_string_adaptor<stringT>,
class SAX_parser = SAX::XMLReader<stringT, string_adaptorT> >
class SAX_parser = Arabica::SAX::XMLReader<stringT, string_adaptorT> >
class Parser : public SAX2DOM::Parser<stringT, string_adaptorT, SAX_parser>
{
typedef SAX2DOM::Parser<stringT, string_adaptorT, SAX_parser> BaseT;

View file

@ -20,18 +20,18 @@ namespace SAX2DOM
template<class stringT,
class string_adaptorT = Arabica::default_string_adaptor<stringT>,
class SAX_parser = SAX::XMLReader<stringT, string_adaptorT> >
class Parser : protected SAX::basic_DefaultHandler<stringT>
class SAX_parser = Arabica::SAX::XMLReader<stringT, string_adaptorT> >
class Parser : protected Arabica::SAX::basic_DefaultHandler<stringT>
{
typedef SAX::basic_EntityResolver<stringT> EntityResolverT;
typedef SAX::basic_ErrorHandler<stringT> ErrorHandlerT;
typedef SAX::basic_LexicalHandler<stringT> LexicalHandlerT;
typedef SAX::basic_DeclHandler<stringT> DeclHandlerT;
typedef SAX::basic_InputSource<stringT> InputSourceT;
typedef Arabica::SAX::basic_EntityResolver<stringT> EntityResolverT;
typedef Arabica::SAX::basic_ErrorHandler<stringT> ErrorHandlerT;
typedef Arabica::SAX::basic_LexicalHandler<stringT> LexicalHandlerT;
typedef Arabica::SAX::basic_DeclHandler<stringT> DeclHandlerT;
typedef Arabica::SAX::basic_InputSource<stringT> InputSourceT;
typedef SimpleDOM::EntityImpl<stringT, string_adaptorT> EntityT;
typedef SimpleDOM::NotationImpl<stringT, string_adaptorT> NotationT;
typedef SimpleDOM::ElementImpl<stringT, string_adaptorT> ElementT;
typedef typename SAX::basic_ErrorHandler<stringT>::SAXParseExceptionT SAXParseExceptionT;
typedef typename Arabica::SAX::basic_ErrorHandler<stringT>::SAXParseExceptionT SAXParseExceptionT;
public:
Parser() :
@ -39,7 +39,7 @@ class Parser : protected SAX::basic_DefaultHandler<stringT>
errorHandler_(0),
documentType_(0)
{
SAX::FeatureNames<stringT, string_adaptorT> fNames;
Arabica::SAX::FeatureNames<stringT, string_adaptorT> fNames;
features_.insert(std::make_pair(fNames.namespaces, true));
features_.insert(std::make_pair(fNames.namespace_prefixes, true));
features_.insert(std::make_pair(fNames.validation, false));
@ -64,7 +64,7 @@ class Parser : protected SAX::basic_DefaultHandler<stringT>
{
typename Features::const_iterator f = features_.find(name);
if(f == features_.end())
throw SAX::SAXNotRecognizedException(std::string("Feature not recognized ") + string_adaptorT::asStdString(name));
throw Arabica::SAX::SAXNotRecognizedException(std::string("Feature not recognized ") + string_adaptorT::asStdString(name));
return f->second;
} // getFeature
@ -76,7 +76,7 @@ class Parser : protected SAX::basic_DefaultHandler<stringT>
bool parse(InputSourceT& source)
{
SAX::PropertyNames<stringT, string_adaptorT> pNames;
Arabica::SAX::PropertyNames<stringT, string_adaptorT> pNames;
DOM::DOMImplementation<stringT> di = SimpleDOM::DOMImplementation<stringT, string_adaptorT>::getDOMImplementation();
document_ = di.createDocument(string_adaptorT::construct_from_utf8(""), string_adaptorT::construct_from_utf8(""), 0);
@ -151,7 +151,7 @@ class Parser : protected SAX::basic_DefaultHandler<stringT>
EntityResolverT* entityResolver_;
ErrorHandlerT* errorHandler_;
SAX::AttributeTypes<stringT, string_adaptorT> attributeTypes_;
Arabica::SAX::AttributeTypes<stringT, string_adaptorT> attributeTypes_;
protected:
template<class interfaceT>
@ -165,7 +165,7 @@ class Parser : protected SAX::basic_DefaultHandler<stringT>
parser.setProperty(propertyName, *(interfaceT*)this);
#endif
} // try
catch(SAX::SAXException&) { }
catch(Arabica::SAX::SAXException&) { }
} // setParserProperty
void setParserFeatures(SAX_parser& parser) const
@ -174,7 +174,7 @@ class Parser : protected SAX::basic_DefaultHandler<stringT>
try {
parser.setFeature(f->first, f->second);
}
catch(const SAX::SAXException&) { }
catch(const Arabica::SAX::SAXException&) { }
} // setParserFeatures
///////////////////////////////////////////////////////////
@ -185,7 +185,7 @@ class Parser : protected SAX::basic_DefaultHandler<stringT>
} // endDocument
virtual void startElement(const stringT& namespaceURI, const stringT& localName,
const stringT& qName, const SAX::basic_Attributes<stringT>& atts)
const stringT& qName, const Arabica::SAX::basic_Attributes<stringT>& atts)
{
if(currentNode_ == 0)
return;

View file

@ -8,6 +8,8 @@
#include <SAX/ArabicaConfig.hpp>
namespace Arabica
{
namespace SAX
{
@ -189,7 +191,8 @@ typedef basic_AttributeList<std::string> AttributeList;
typedef basic_AttributeList<std::wstring> wAttributeList;
#endif
}; // namespace SAX
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -8,6 +8,8 @@
#include <SAX/ArabicaConfig.hpp>
namespace Arabica
{
namespace SAX
{
@ -230,7 +232,8 @@ typedef basic_Attributes<std::string> Attributes;
typedef basic_Attributes<std::wstring> wAttributes;
#endif
}; // namespace SAX
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -8,6 +8,8 @@
#include <SAX/ArabicaConfig.hpp>
namespace Arabica
{
namespace SAX
{
@ -337,7 +339,8 @@ typedef basic_ContentHandler<std::string> ContentHandler;
typedef basic_ContentHandler<std::wstring> wContentHandler;
#endif
}; // namespace SAX
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -8,6 +8,8 @@
#include <SAX/ArabicaConfig.hpp>
namespace Arabica
{
namespace SAX
{
@ -124,7 +126,8 @@ typedef basic_DTDHandler<std::string> DTDHandler;
typedef basic_DTDHandler<std::wstring> wDTDHandler;
#endif
}; // namespace SAX
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -5,6 +5,8 @@
#include <SAX/ArabicaConfig.hpp>
namespace Arabica
{
namespace SAX
{
@ -72,7 +74,8 @@ typedef basic_DocumentHandler<std::string> DocumentHandler;
typedef basic_DocumentHandler<std::wstring> wDocumentHandler;
#endif
}; // namespace SAX
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -10,6 +10,8 @@
#include <SAX/InputSource.hpp>
namespace Arabica
{
namespace SAX
{
@ -114,7 +116,8 @@ typedef basic_EntityResolver<std::string> EntityResolver;
typedef basic_EntityResolver<std::wstring> wEntityResolver;
#endif
}; // namespace SAX
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -10,6 +10,8 @@
#include <SAX/SAXParseException.hpp>
namespace Arabica
{
namespace SAX
{
@ -120,7 +122,8 @@ typedef basic_ErrorHandler<std::string> ErrorHandler;
typedef basic_ErrorHandler<std::wstring> wErrorHandler;
#endif
}; // namespace SAX
} // namespace SAX
} // namespace Arabica
#endif
//end of file

View file

@ -15,6 +15,8 @@
#include <SAX/AttributeList.hpp>
#include <SAX/SAXException.hpp>
namespace Arabica
{
namespace SAX
{
@ -287,7 +289,8 @@ typedef basic_HandlerBase<std::string> HandlerBase;
typedef basic_HandlerBase<std::wstring> wHandlerBase;
#endif
}; // namespace SAX
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -21,6 +21,7 @@
#define ISTREAMHANDLE_POSTCONDITION(x) do {} while (false)
#endif
namespace Arabica {
namespace SAX {
/** Reference-counting pointer to std::istream.
@ -445,6 +446,7 @@ void IStreamHandle::removeRef()
}
} // namespace SAX
} // namespace Arabica
#endif /* SAX_ISTREAMHANDLE_H */

View file

@ -10,6 +10,8 @@
#include <SAX/ArabicaConfig.hpp>
#include <SAX/IStreamHandle.hpp>
namespace Arabica
{
namespace SAX
{
@ -334,7 +336,8 @@ typedef basic_InputSource<std::string> InputSource;
typedef basic_InputSource<std::wstring> wInputSource;
#endif
}; // namespace SAX
} // namespace SAX
} // namespace Arabica
#endif // #define InputSourceH
// end of file

View file

@ -8,6 +8,8 @@
#include <SAX/ArabicaConfig.hpp>
namespace Arabica
{
namespace SAX
{
@ -127,7 +129,8 @@ typedef basic_Locator<std::string> Locator;
typedef basic_Locator<std::wstring> wLocator;
#endif
}; // namespace SAX
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -12,6 +12,8 @@
#include <saxfwd.h>
namespace Arabica
{
namespace SAX
{
@ -161,7 +163,8 @@ typedef basic_Parser<std::string> Parser;
typedef basic_Parser<std::wstring> wParser;
#endif
}; // namespace SAX
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -61,6 +61,8 @@
#ifndef NO_DEFAULT_PARSER
#ifdef DEF_SAX_P
namespace Arabica
{
namespace SAX
{
#ifdef HAVE_BOOST
@ -74,6 +76,7 @@ namespace SAX
#endif
class XMLReader : public DEF_SAX_P<string_type, T0, T1> { };
} // namespace SAX
} // namespace Arabica
#else
#error "No default parser defined."
#endif

View file

@ -8,6 +8,8 @@
#include <SAX/ArabicaConfig.hpp>
namespace Arabica
{
namespace SAX
{
@ -60,6 +62,7 @@ private:
bool operator==(const SAXException&);
}; // class SAXException
}; // namespace SAX
} // namespace SAX
} // namespace Arabica
#endif // SAXExceptionH

View file

@ -7,6 +7,8 @@
#include <SAX/SAXException.hpp>
namespace Arabica
{
namespace SAX
{
@ -46,6 +48,7 @@ public:
}; // class SAXNotRecognizedException
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -7,6 +7,8 @@
#include <SAX/SAXException.hpp>
namespace Arabica
{
namespace SAX
{
@ -48,6 +50,7 @@ public:
}; // class SAXNotSupportedException
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -9,6 +9,8 @@
#include <sstream>
#include <Utils/convertstream.hpp>
namespace Arabica
{
namespace SAX
{
@ -168,7 +170,8 @@ typedef basic_SAXParseException<std::string> SAXParseException;
typedef basic_SAXParseException<std::wstring> wSAXParseException;
#endif
}; // namespace SAX
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -9,6 +9,8 @@
#include <SAX/XMLReader.hpp>
namespace Arabica
{
namespace SAX
{
@ -68,7 +70,8 @@ typedef basic_XMLFilter<std::string> XMLFilter;
typedef basic_XMLFilter<std::wstring> wXMLFilter;
#endif
}; // namespace SAX
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -18,7 +18,8 @@
#include <SAX/ext/DeclHandler.hpp>
#include <SAX/SAXNotSupportedException.hpp>
namespace Arabica
{
namespace SAX
{
@ -432,7 +433,8 @@ public:
} // setProperty
}; // class basic_XMLReader
}; // namespace SAX
} // namespace SAX
} // namespace Arabica
/* Included to ensure that #include<SAX/XMLReader.hpp> defines a class called
* XMLReader.

View file

@ -7,6 +7,8 @@
#include <SAX/ArabicaConfig.hpp>
#include <SAX/Attributes.hpp>
namespace Arabica
{
namespace SAX
{
@ -75,7 +77,8 @@ typedef basic_Attributes2<std::string> Attributes2;
typedef basic_Attributes2<std::wstring> wAttributes2;
#endif
}; // namespace SAX
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -7,6 +7,8 @@
#include <string>
#include <SAX/ArabicaConfig.hpp>
namespace Arabica
{
namespace SAX
{
@ -131,7 +133,8 @@ typedef basic_DeclHandler<std::string> DeclHandler;
typedef basic_DeclHandler<std::wstring> wDeclHandler;
#endif
}; // namespace SAX
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -11,7 +11,10 @@
#pragma message("DefaultHandler2 is deprecated. You can now use DefaultHandler instead.")
namespace SAX {
namespace Arabica
{
namespace SAX
{
/**
* Default base class for SAX2 event handlers.
@ -58,5 +61,6 @@ typedef basic_DefaultHandler2<std::wstring> wDefaultHandler2;
#endif
} // namespace SAX
} // namespace Arabica
#endif

View file

@ -7,6 +7,8 @@
#include <string>
#include <SAX/ArabicaConfig.hpp>
namespace Arabica
{
namespace SAX
{
@ -191,7 +193,8 @@ typedef basic_LexicalHandler<std::string> LexicalHandler;
typedef basic_LexicalHandler<std::wstring> wLexicalHandler;
#endif
}; // namespace SAX
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -7,6 +7,8 @@
#include <SAX/ArabicaConfig.hpp>
#include <SAX/Locator.hpp>
namespace Arabica
{
namespace SAX
{
@ -70,7 +72,8 @@ typedef basic_Locator2<std::string> Locator2;
typedef basic_Locator2<std::wstring> wLocator2;
#endif
}; // namespace SAX
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -6,6 +6,8 @@
// $Id$
namespace Arabica
{
namespace SAX
{
/** Abstract base class for the parser-specific XMLPScanToken data.
@ -157,7 +159,8 @@ namespace SAX
#ifndef ARABICA_NO_WCHAR_T
typedef basic_ProgressiveParser<std::wstring> wProgressiveParser;
#endif
}; // namespace SAX
} // namespace SAX
} // namespace Arabica
#endif /* PROGRESSIVE_PARSER_H */
// end of file

View file

@ -7,6 +7,8 @@
#include <SAX/helpers/NamespaceSupport.hpp>
#include <Utils/StringAdaptor.hpp>
namespace Arabica
{
namespace SAX
{
@ -90,5 +92,6 @@ private:
}; // class NamespaceTracker
} // namespace SAX
} // namespace Arabica
#endif

View file

@ -6,7 +6,10 @@
#include <XML/UnicodeCharacters.hpp>
#include <ostream>
namespace SAX {
namespace Arabica
{
namespace SAX
{
template<class string_type>
class PYXWriter : public basic_XMLFilterImpl<string_type>
@ -110,5 +113,6 @@ void PYXWriter<string_type>::escape(const stringT& ch)
} // escape
} // namespace SAX
} // namespace Arabica
#endif

View file

@ -5,6 +5,8 @@
#include <SAX/helpers/XMLFilterImpl.hpp>
#include <Utils/StringAdaptor.hpp>
namespace Arabica
{
namespace SAX
{
@ -94,4 +96,6 @@ private:
}; // class basic_TextCoalescer
} // namespace SAX
} // namespace Arabica
#endif

View file

@ -5,6 +5,8 @@
#include <SAX/helpers/XMLFilterImpl.hpp>
#include <Utils/StringAdaptor.hpp>
namespace Arabica
{
namespace SAX
{
@ -59,4 +61,6 @@ public:
}; // class TextOnly
} // namespace SAX
} // namespace Arabica
#endif

View file

@ -5,6 +5,8 @@
#include <Utils/normalize_whitespace.hpp>
namespace Arabica
{
namespace SAX
{
@ -37,5 +39,7 @@ class WhitespaceStripper : public SAX::basic_XMLFilterImpl<string_type>
}; // class WhitespaceStripper
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -12,7 +12,10 @@
#include <algorithm>
#include <typeinfo>
namespace SAX {
namespace Arabica
{
namespace SAX
{
template<class string_type>
class basic_Writer : public basic_XMLFilterImpl<string_type>
@ -631,5 +634,6 @@ typedef basic_Writer<std::wstring> wWriter;
#endif
} // namespace SAX
} // namespace Arabica
#endif

View file

@ -6,6 +6,8 @@
#include <SAX/helpers/XMLBaseSupport.hpp>
#include <Utils/StringAdaptor.hpp>
namespace Arabica
{
namespace SAX
{
@ -88,5 +90,6 @@ private:
}; // class XMLBaseTracker
} // namespace SAX
} // namespace Arabica
#endif

View file

@ -7,6 +7,8 @@
#include <SAX/ArabicaConfig.hpp>
#include <Utils/StringAdaptor.hpp>
namespace Arabica
{
namespace SAX
{
@ -29,6 +31,7 @@ struct AttributeDefaults
}; // struct AttributeDefaults
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -8,6 +8,8 @@
#include <vector>
#include <algorithm>
namespace Arabica
{
namespace SAX
{
@ -293,7 +295,8 @@ typedef basic_AttributeListImpl<std::string> AttributeListImpl;
typedef basic_AttributeListImpl<std::wstring> wAttributeListImpl;
#endif
}; // namespace SAX
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -7,6 +7,8 @@
#include <SAX/ArabicaConfig.hpp>
#include <Utils/StringAdaptor.hpp>
namespace Arabica
{
namespace SAX
{
@ -43,6 +45,7 @@ struct AttributeTypes
}; // struct AttributeTypes
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -8,6 +8,8 @@
#include <SAX/Attributes.hpp>
#include <deque>
namespace Arabica
{
namespace SAX
{
@ -560,6 +562,7 @@ typedef basic_AttributesImpl<std::wstring> wAttributesImpl;
#endif
} // namespace SAX
} // namespace Arabica
#endif

View file

@ -7,6 +7,8 @@
* An ErrorHandler implementation that keeps hold of any errors for later reporting.
*/
namespace Arabica
{
namespace SAX
{
template<class string_type>
@ -51,6 +53,7 @@ private:
std::string errors_;
}; // class CatchErrorHandler
} // namespace SAX
} // namespace Arabica
#endif

View file

@ -16,7 +16,10 @@
#include <SAX/ext/DeclHandler.hpp>
#include <SAX/ext/LexicalHandler.hpp>
namespace SAX {
namespace Arabica
{
namespace SAX
{
/**
* Default base class for SAX2 event handlers.
@ -599,5 +602,6 @@ typedef basic_DefaultHandler<std::wstring> wDefaultHandler;
#endif
} // namespace SAX
} // namespace Arabica
#endif

View file

@ -7,6 +7,8 @@
#include <SAX/ArabicaConfig.hpp>
#include <Utils/StringAdaptor.hpp>
namespace Arabica
{
namespace SAX
{
@ -90,6 +92,7 @@ struct FeatureNames
}; // class FeatureNames
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -6,6 +6,11 @@
#include <map>
#include <SAX/InputSource.hpp>
namespace Arabica
{
namespace SAX
{
class InputSourceResolver
{
public:
@ -54,5 +59,7 @@ private:
} // resolverMap
}; // class InputSourceResolver
} // namespace SAX
} // namespace Arabica
#endif

View file

@ -8,6 +8,8 @@
#include <string>
#include <Locator.hpp>
namespace Arabica
{
namespace SAX
{
@ -165,7 +167,8 @@ typedef basic_LocatorImpl<std::string> LocatorImpl;
typedef basic_LocatorImpl<std::wstring> wLocatorImpl;
#endif
}; // namespace SAX
} // namespace SAX
} // namespace Arabica
#endif
//end of file

View file

@ -10,6 +10,8 @@
#include <map>
#include <vector>
namespace Arabica
{
namespace SAX
{
@ -397,6 +399,7 @@ class basic_NamespaceSupport
bool operator==(const basic_NamespaceSupport&) const;
}; // class basic_NamespaceSupport
}; // namespace SAX
} // namespace SAX
} // namespace Arabica
#endif // NamespaceSupportH

View file

@ -17,6 +17,8 @@
#include <SAX/SAXNotRecognizedException.hpp>
#include <sstream>
namespace Arabica
{
namespace SAX
{
@ -548,5 +550,6 @@ typedef basic_ParserAdaptor<std::wstring, wchar_t> wParserAdaptor;
#endif
} // namespace SAX
} // namespace Arabica
#endif

View file

@ -8,6 +8,8 @@
#include <SAX/XMLReader.hpp>
#include <Utils/StringAdaptor.hpp>
namespace Arabica
{
namespace SAX
{
@ -45,6 +47,7 @@ struct PropertyNames
}; // struct PropertyNames
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -22,6 +22,8 @@
#include <XML/UnicodeCharacters.hpp>
#include <Utils/uri.hpp>
namespace Arabica
{
namespace SAX
{
@ -127,6 +129,7 @@ typedef basic_XMLBaseSupport<std::wstring> wXMLBaseSupport;
#endif
} // namespace SAX
} // namespace Arabica
#endif

View file

@ -10,6 +10,8 @@
#include <SAX/SAXNotRecognizedException.hpp>
#include <Utils/StringAdaptor.hpp>
namespace Arabica
{
namespace SAX
{
@ -605,7 +607,8 @@ typedef basic_XMLFilterImpl<std::string> XMLFilterImpl;
typedef basic_XMLFilterImpl<std::wstring> wXMLFilterImpl;
#endif
}; // namespace SAX
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -16,7 +16,10 @@
#include <Utils/StringAdaptor.hpp>
#include <Utils/getparam.hpp>
namespace SAX {
namespace Arabica
{
namespace SAX
{
template<class string_type,
class T0 = Arabica::nil_t,
@ -457,5 +460,6 @@ void Garden<string_type, T0, T1>::reportError(const std::string& message, bool f
} // reportError
} // namespace SAX
} // namespace Arabica
#endif

View file

@ -68,6 +68,8 @@
* SAX in C++ - A C++ implementation of the SAX2 interface.
*
*/
namespace Arabica
{
namespace SAX
{
@ -103,7 +105,8 @@ typedef basic_SAXParseException<std::wstring> wSAXParseException;
typedef basic_ErrorHandler<std::wstring> wErrorHandler;
#endif
}; // namespace SAX
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -7,6 +7,8 @@
#include <SAX/ArabicaConfig.hpp>
#include <Utils/StringAdaptor.hpp>
namespace Arabica
{
namespace SAX
{
template<class string_type, class string_adaptor_type = Arabica::default_string_adaptor<string_type> >
@ -172,6 +174,7 @@ namespace SAX
} // XercesFeatureNames
}; // class XercesFeatureNames
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -7,6 +7,8 @@
#include <Utils/StringAdaptor.hpp>
#include <SAX/helpers/PropertyNames.hpp>
namespace Arabica
{
namespace SAX
{
template<class string_type,
@ -72,6 +74,7 @@ namespace SAX
} // XercesPropertyNames()
}; // class XercesPropertyNames
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -26,6 +26,8 @@
#include <map>
#include <Utils/getparam.hpp>
namespace Arabica
{
namespace SAX
{
@ -1059,7 +1061,8 @@ int expat_wrapper<stringT, T0, T1>::externalEntityRefHandler(XML_Parser parser,
return ok;
} // externalEntityRefHandler
}; // namespace SAX
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -27,6 +27,8 @@
#include <SAX/helpers/AttributesImpl.hpp>
#include <Utils/getparam.hpp>
namespace Arabica
{
namespace SAX
{
@ -847,5 +849,6 @@ xmlParserInputPtr libxml2_wrapper<stringT, T0, T1>::SAXresolveEntity(const xmlCh
} // namespace SAX
} // namespace Arabica
#endif

View file

@ -23,6 +23,8 @@
#include <comdef.h>
_COM_SMARTPTR_TYPEDEF(ISAXXMLReader, __uuidof(ISAXXMLReader));
namespace Arabica
{
namespace SAX
{
@ -945,6 +947,7 @@ void msxml2_wrapper<string_type, T0, T1>::parse(SAX::basic_InputSource<string_ty
} // parse
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -74,6 +74,8 @@ std::ostream& operator<<(std::ostream& o, const std::type_info& ti)
#define XERCES_CPP_NAMESPACE
#endif
namespace Arabica
{
namespace SAX
{
@ -1177,6 +1179,7 @@ void xerces_wrapper<string_type, T0, T1>::parseReset(XMLPScanToken& token)
} // parseReset
} // namespace SAX
} // namespace Arabica
#endif
// end of file

View file

@ -13,7 +13,9 @@
#include <Utils/uri.hpp>
#include <cmath>
InputSourceResolver::InputSourceResolver(const SAX::InputSource& inputSource) :
using namespace Arabica::SAX;
InputSourceResolver::InputSourceResolver(const Arabica::SAX::InputSource& inputSource) :
deleteStream_(false),
byteStream_(0)
{

View file

@ -8,6 +8,8 @@
#include <SAX/ParserConfig.hpp>
namespace Arabica
{
namespace SAX
{
@ -129,6 +131,7 @@ int ewim_externalEntityRefHandler(XML_Parser parser,
} // namespace expat_wrapper_impl_mumbojumbo
} // namespace SAX
} // namespace Arabica
// end of file

View file

@ -10,6 +10,8 @@
#include <SAX/SAXNotRecognizedException.hpp>
namespace Arabica
{
namespace SAX
{
namespace libxml2_wrapper_impl_tiddle
@ -221,5 +223,6 @@ bool lwit_getFeature(xmlParserCtxtPtr context, const char* name)
} // namespace libxml2_wrapper_impl_tiddle
} // namespace SAX
} // namespace Arabica
// end of file

View file

@ -8,6 +8,8 @@
#include <SAX/ParserConfig.hpp>
#include <SAX/wrappers/saxxerces.hpp>
namespace Arabica
{
namespace SAX
{
@ -31,4 +33,5 @@ namespace XercesImpl
} //namespace xerces_implemenation_helper
} // namespace SAX
} // namespace Arabica
// end of file

View file

@ -28,8 +28,8 @@ class SAX2DOMTest : public TestCase
std::stringstream ss;
ss << SA::asStdString(str);
SAX::basic_InputSource<string_type> is(ss);
SAX::CatchErrorHandler<string_type> eh;
Arabica::SAX::basic_InputSource<string_type> is(ss);
Arabica::SAX::CatchErrorHandler<string_type> eh;
SAX2DOM::Parser<string_type, string_adaptor> parser;
parser.setErrorHandler(eh);
parser.parse(is);
@ -157,7 +157,7 @@ class SAX2DOMTest : public TestCase
parser.getFeature(SA::construct_from_utf8("made up name"));
assert(false);
}
catch(const SAX::SAXNotRecognizedException&)
catch(const Arabica::SAX::SAXNotRecognizedException&)
{
}
} // test12

View file

@ -28,8 +28,8 @@ class TreeWalkerTest : public TestCase
std::stringstream ss;
ss << SA::asStdString(str);
SAX::basic_InputSource<string_type> is(ss);
SAX::CatchErrorHandler<string_type> eh;
Arabica::SAX::basic_InputSource<string_type> is(ss);
Arabica::SAX::CatchErrorHandler<string_type> eh;
SAX2DOM::Parser<string_type, string_adaptor> parser;
parser.setErrorHandler(eh);
parser.parse(is);

View file

@ -32,8 +32,8 @@ class WhitespaceStripperTest : public TestCase
void testNoStrip()
{
std::ostringstream o;
SAX::XMLReader<std::string> parser;
SAX::PYXWriter<std::string> writer(o, parser);
Arabica::SAX::XMLReader<std::string> parser;
Arabica::SAX::PYXWriter<std::string> writer(o, parser);
writer.parse(*source("<test><p> Woo baby hooray </p></test>"));
assertEquals("(test\n(p\n- Woo baby hooray \n)p\n)test\n", o.str());
} // testNoStrip
@ -41,9 +41,9 @@ class WhitespaceStripperTest : public TestCase
void testStripLeading()
{
std::ostringstream o;
SAX::XMLReader<std::string> parser;
SAX::WhitespaceStripper<std::string> stripper(parser);
SAX::PYXWriter<std::string> writer(o, stripper);
Arabica::SAX::XMLReader<std::string> parser;
Arabica::SAX::WhitespaceStripper<std::string> stripper(parser);
Arabica::SAX::PYXWriter<std::string> writer(o, stripper);
writer.parse(*source("<test><p>Woo</p></test>"));
assertEquals("(test\n(p\n-Woo\n)p\n)test\n", o.str());
@ -59,9 +59,9 @@ class WhitespaceStripperTest : public TestCase
void testStripTrailing()
{
std::ostringstream o;
SAX::XMLReader<std::string> parser;
SAX::WhitespaceStripper<std::string> stripper(parser);
SAX::PYXWriter<std::string> writer(o, stripper);
Arabica::SAX::XMLReader<std::string> parser;
Arabica::SAX::WhitespaceStripper<std::string> stripper(parser);
Arabica::SAX::PYXWriter<std::string> writer(o, stripper);
writer.parse(*source("<test><p>Woo</p></test>"));
assertEquals("(test\n(p\n-Woo\n)p\n)test\n", o.str());
@ -77,9 +77,9 @@ class WhitespaceStripperTest : public TestCase
void testStripMid()
{
std::ostringstream o;
SAX::XMLReader<std::string> parser;
SAX::WhitespaceStripper<std::string> stripper(parser);
SAX::PYXWriter<std::string> writer(o, stripper);
Arabica::SAX::XMLReader<std::string> parser;
Arabica::SAX::WhitespaceStripper<std::string> stripper(parser);
Arabica::SAX::PYXWriter<std::string> writer(o, stripper);
writer.parse(*source("<test><p>Woo yea</p></test>"));
assertEquals("(test\n(p\n-Woo yea\n)p\n)test\n", o.str());
@ -95,9 +95,9 @@ class WhitespaceStripperTest : public TestCase
void testStripMid2()
{
std::ostringstream o;
SAX::XMLReader<std::string> parser;
SAX::WhitespaceStripper<std::string> stripper(parser);
SAX::PYXWriter<std::string> writer(o, stripper);
Arabica::SAX::XMLReader<std::string> parser;
Arabica::SAX::WhitespaceStripper<std::string> stripper(parser);
Arabica::SAX::PYXWriter<std::string> writer(o, stripper);
writer.parse(*source("<test><p>Woo yea man</p></test>"));
assertEquals("(test\n(p\n-Woo yea man\n)p\n)test\n", o.str());
@ -117,19 +117,19 @@ class WhitespaceStripperTest : public TestCase
void testStrip()
{
std::ostringstream o;
SAX::XMLReader<std::string> parser;
SAX::WhitespaceStripper<std::string> stripper(parser);
SAX::PYXWriter<std::string> writer(o, stripper);
Arabica::SAX::XMLReader<std::string> parser;
Arabica::SAX::WhitespaceStripper<std::string> stripper(parser);
Arabica::SAX::PYXWriter<std::string> writer(o, stripper);
writer.parse(*source("<test><p> Woo baby hooray </p><!-- yo mama --></test>"));
assertEquals("(test\n(p\n-Woo baby hooray\n)p\n)test\n", o.str());
} // testStrip
private:
std::auto_ptr<SAX::InputSource> source(const std::string& str)
std::auto_ptr<Arabica::SAX::InputSource> source(const std::string& str)
{
std::auto_ptr<std::iostream> ss(new std::stringstream());
(*ss) << str;
return std::auto_ptr<SAX::InputSource>(new SAX::InputSource(ss));
return std::auto_ptr<Arabica::SAX::InputSource>(new Arabica::SAX::InputSource(ss));
} // source
}; // WhitespaceStripperTest

View file

@ -404,8 +404,8 @@ public:
std::stringstream ss;
ss << match;
SAX::basic_InputSource<string_type> is(ss);
SAX::CatchErrorHandler<string_type> eh;
Arabica::SAX::basic_InputSource<string_type> is(ss);
Arabica::SAX::CatchErrorHandler<string_type> eh;
SAX2DOM::Parser<string_type, string_adaptor> parser;
parser.setErrorHandler(eh);
parser.parse(is);

View file

@ -18,7 +18,7 @@ const std::string SEPERATOR = "/";
DOM::Document<std::string> buildDOM(const std::string& filename)
{
SAX::InputSource is(filename);
Arabica::SAX::InputSource is(filename);
SAX2DOM::Parser<std::string> parser;
parser.parse(is);
@ -85,7 +85,7 @@ protected:
{
Arabica::XSLT::StylesheetCompiler compiler;
SAX::InputSource source(input_xslt_);
Arabica::SAX::InputSource source(input_xslt_);
std::auto_ptr<Arabica::XSLT::Stylesheet> stylesheet = compiler.compile(source);
if(stylesheet.get() != 0)
assertImplementation(false, "Expected " + input_xslt_ + " not to compile. But it did :o");
@ -113,7 +113,7 @@ protected:
{
Arabica::XSLT::StylesheetCompiler compiler;
SAX::InputSource source(input_xslt_);
Arabica::SAX::InputSource source(input_xslt_);
std::auto_ptr<Arabica::XSLT::Stylesheet> stylesheet = compiler.compile(source);
if(stylesheet.get() == 0)
assertImplementation(false, "Failed to compile " + input_xslt_ + " : " + compiler.error());
@ -158,7 +158,7 @@ protected:
{
Arabica::XSLT::StylesheetCompiler compiler;
SAX::InputSource source(input_xslt_);
Arabica::SAX::InputSource source(input_xslt_);
std::auto_ptr<Arabica::XSLT::Stylesheet> stylesheet = compiler.compile(source);
if(stylesheet.get() == 0)
assertImplementation(false, "Failed to compile " + input_xslt_ + " : " + compiler.error());