mirror of
https://github.com/jezhiggins/arabica
synced 2024-11-15 19:48:00 +01:00
moved DOM streaming from Utils/ to io/
This commit is contained in:
parent
0e02b8cdf3
commit
f213c402cd
5 changed files with 20 additions and 23 deletions
|
@ -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[])
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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>
|
||||
|
||||
////////////////////////////////////////////////
|
||||
|
|
|
@ -34,19 +34,18 @@ namespace Arabica
|
|||
namespace DOM
|
||||
{
|
||||
|
||||
namespace StreamImpl
|
||||
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)
|
||||
{
|
||||
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
|
||||
stream << child;
|
||||
child = child.getNextSibling();
|
||||
} // while
|
||||
} // 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;
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue