moved DOM streaming from Utils/ to io/

This commit is contained in:
jez 2007-09-13 21:21:55 +00:00
parent 0e02b8cdf3
commit f213c402cd
5 changed files with 20 additions and 23 deletions

View file

@ -8,7 +8,7 @@
#include <string>
#include <DOM/SAX2DOM/SAX2DOM.hpp>
#include <SAX/helpers/CatchErrorHandler.hpp>
#include <DOM/Utils/Stream.hpp>
#include <DOM/io/Stream.hpp>
////////////////////////////////////////////////
int main(int argc, char* argv[])

View file

@ -4,7 +4,8 @@
// It's a pretty literal translation of the Sean McGrath's
// sax2pyx.py code presented in his XML Processing In Python book.
//
// For more information on PYX see http://pyxie.sourceforce.net/
// For more information on PYX see
// http://www.xml.com/pub/a/2000/03/15/feature
//
// $Id$
//
@ -53,11 +54,6 @@ int main(int argc, char* argv[])
Arabica::SAX::XMLReader<std::string> myParser;
myParser.setContentHandler(handler);
myParser.setErrorHandler(handler);
try {
myParser.setFeature("prohibit-dtd", false);
}
catch(...) {
}
Arabica::SAX::InputSource<std::string> is(argv[i]);
myParser.parse(is);

View file

@ -8,7 +8,7 @@
#include <string>
#include <SAX/helpers/CatchErrorHandler.hpp>
#include <DOM/SAX2DOM/SAX2DOM.hpp>
#include <DOM/Utils/Stream.hpp>
#include <DOM/io/Stream.hpp>
#include <XPath/XPath.hpp>
////////////////////////////////////////////////

View file

@ -34,19 +34,18 @@ namespace Arabica
namespace DOM
{
namespace StreamImpl
{
template<class stringT, class string_adaptorT, class charT, class traitsT>
void streamChildren(std::basic_ostream<charT, traitsT>& stream, DOM::Node<stringT, string_adaptorT>& node)
{
namespace StreamImpl
{
template<class stringT, class string_adaptorT, class charT, class traitsT>
void streamChildren(std::basic_ostream<charT, traitsT>& stream, DOM::Node<stringT, string_adaptorT>& node)
{
DOM::Node<stringT> child = node.getFirstChild();
while(child != 0)
{
stream << child;
child = child.getNextSibling();
} // while
} // streamChildren
} // namespace StreamImpl
} // streamChildren
template<class stringT>
void prefix_mapper_callback(std::ios_base::event ev, std::ios_base& stream, int index)
@ -206,6 +205,8 @@ void prefix_mapper_pop(std::basic_ostream<charT, traitsT>& stream,
} // if ...
} // prefix_mapper_pop
} // namespace StreamImpl
template<class stringT, class string_adaptorT, class charT, class traitsT>
std::basic_ostream<charT, traitsT>&
operator<<(std::basic_ostream<charT, traitsT>& stream,
@ -243,11 +244,11 @@ operator<<(std::basic_ostream<charT, traitsT>& stream,
case DOM::Node<stringT>::ELEMENT_NODE:
{
stream << UnicodeT::LESS_THAN_SIGN;
int index = prefix_mapper(stream, node);
int index = StreamImpl::prefix_mapper(stream, node);
stream << UnicodeT::GREATER_THAN_SIGN;
StreamImpl::streamChildren(stream, node);
stream << UnicodeT::LESS_THAN_SIGN << UnicodeT::SLASH;
prefix_mapper_pop(stream, node, index);
StreamImpl::prefix_mapper_pop(stream, node, index);
stream << UnicodeT::GREATER_THAN_SIGN;
}
break;

View file

@ -3,7 +3,7 @@
#include <SAX/InputSource.hpp>
#include <DOM/SAX2DOM/SAX2DOM.hpp>
#include <DOM/Utils/Stream.hpp>
#include <DOM/io/Stream.hpp>
#include <XSLT/XSLT.hpp>
#ifdef ARABICA_WINDOWS