27 #ifndef STDCASA_XERCES_
28 #define STDCASA_XERCES_
30 #include <xercesc/dom/DOM.hpp>
31 #include <xercesc/parsers/XercesDOMParser.hpp>
32 #include <xercesc/util/PlatformUtils.hpp>
33 #include <xercesc/dom/DOMImplementation.hpp>
34 #include <xercesc/dom/DOMImplementationLS.hpp>
35 #include <xercesc/framework/LocalFileFormatTarget.hpp>
36 #include <xercesc/framework/Wrapper4InputSource.hpp>
37 #include <xercesc/parsers/XercesDOMParser.hpp>
41 #if XERCES_VERSION_MAJOR > 2
42 typedef xercesc::DOMLSSerializer
Writer;
43 typedef xercesc::DOMLSParser
Parser;
44 #if defined(DEFINE_CASA_XERCES_STATICS)
45 static const XMLCh *fgDOMValidate = xercesc::XMLUni::fgDOMValidate;
47 inline Writer *
create_writer(
void *impl) {
return static_cast<xercesc::DOMImplementationLS*
>(impl)->createLSSerializer( ); }
48 inline Parser *
create_parser(
void *impl) {
return static_cast<xercesc::DOMImplementationLS*
>(impl)->createLSParser(xercesc::DOMImplementationLS::MODE_SYNCHRONOUS,0 ); }
49 inline XMLCh *
write_to_string(
Writer *writer, xercesc::DOMNode *n ) {
return writer->writeToString(n); }
50 inline xercesc::DOMDocument *
dom_parse(
Parser *parser,
const xercesc::Wrapper4InputSource &source ) {
return parser->parse(&source); }
51 inline bool write_to_file(
Writer *writer, xercesc::DOMNode *n, std::string
file,
const XMLCh *
const encoding ) {
52 xercesc::DOMImplementation* impl=xercesc::DOMImplementationRegistry::getDOMImplementation(xercesc::XMLString::transcode(
"LS"));
53 xercesc::DOMLSOutput *sink =
static_cast<xercesc::DOMImplementationLS*
>(impl)->createLSOutput();
54 xercesc::LocalFileFormatTarget fileTarget(file.c_str());
55 sink->setEncoding(encoding);
56 sink->setByteStream(&fileTarget);
57 bool result = writer->write(n,sink);
64 inline void set_parameter(
Parser *parser,
const XMLCh *name, T value ) {
return parser->getDomConfig()->setParameter(name,value); }
68 #if defined(DEFINE_CASA_XERCES_STATICS)
69 static const XMLCh *fgDOMValidate = xercesc::XMLUni::fgDOMValidation;
71 inline Writer *
create_writer(
void *impl) {
return static_cast<xercesc::DOMImplementationLS*
>(impl)->createDOMWriter( ); }
72 inline Parser *
create_parser(
void *impl) {
return static_cast<xercesc::DOMImplementationLS*
>(impl)->createDOMBuilder(xercesc::DOMImplementationLS::MODE_SYNCHRONOUS, 0); }
74 inline xercesc::DOMDocument *
dom_parse(
Parser *parser,
const xercesc::Wrapper4InputSource &source ) {
return parser->parse(source); }
75 inline bool write_to_file(
Writer *writer, xercesc::DOMNode *n, std::string file,
const XMLCh *
const encoding ) {
76 xercesc::LocalFileFormatTarget fileTarget(file.c_str());
77 writer->setEncoding(encoding);
78 return writer->writeNode(&fileTarget,*n);
83 inline void set_parameter(
Parser *parser,
const XMLCh *name, T value ) {
return parser->setFeature(name,value); }
void set_parameter(Parser *parser, const XMLCh *name, T value)
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the if a human readable name(i.e."black").In many places throughout the plotter
XMLCh * write_to_string(Writer *writer, xercesc::DOMNode *n)
xercesc::DOMDocument * dom_parse(Parser *parser, const xercesc::Wrapper4InputSource &source)
bool write_to_file(Writer *writer, xercesc::DOMNode *n, std::string file, const XMLCh *const encoding)
xercesc::DOMWriter Writer
Writer * create_writer(void *impl)
xercesc::DOMBuilder Parser
Parser * create_parser(void *impl)
bool can_set_parameter(Parser *parser, const XMLCh *name, T value)
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
Defines nreal time structures used by the VLA table filler.