/usr/include/xsd/cxx/tree/text.txx is in xsdcxx 3.3.0.1-1.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | // file : xsd/cxx/tree/text.txx
// author : Boris Kolpackov <boris@codesynthesis.com>
// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC
// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
#include <xercesc/dom/DOMText.hpp>
#include <xsd/cxx/xml/string.hxx>
#include <xsd/cxx/tree/exceptions.hxx>
namespace xsd
{
namespace cxx
{
namespace tree
{
template <typename C>
std::basic_string<C>
text_content (const xercesc::DOMElement& e)
{
using xercesc::DOMNode;
using xercesc::DOMText;
DOMNode* n (e.getFirstChild ());
// Fast path.
//
if (n != 0 &&
n->getNodeType () == DOMNode::TEXT_NODE &&
n->getNextSibling () == 0)
{
DOMText* t (static_cast<DOMText*> (n));
// Berkeley DB XML DOM does not implement getLength().
//
#ifndef DBXML_DOM
return xml::transcode<C> (t->getData (), t->getLength ());
#else
return xml::transcode<C> (t->getData ());
#endif
}
std::basic_string<C> r;
for (; n != 0; n = n->getNextSibling ())
{
switch (n->getNodeType ())
{
case DOMNode::TEXT_NODE:
case DOMNode::CDATA_SECTION_NODE:
{
DOMText* t (static_cast<DOMText*> (n));
// Berkeley DB XML DOM does not implement getLength().
//
#ifndef DBXML_DOM
r += xml::transcode<C> (t->getData (), t->getLength ());
#else
r += xml::transcode<C> (t->getData ());
#endif
break;
}
case DOMNode::ELEMENT_NODE:
{
throw expected_text_content<C> ();
}
default:
break; // ignore
}
}
return r;
}
}
}
}
|