4 #include <xercesc/dom/DOMNode.hpp>
5 #include <xercesc/dom/DOM.hpp>
6 #include <xercesc/parsers/XercesDOMParser.hpp>
8 #include <xercesc/util/XMLString.hpp>
9 #include <xercesc/sax/SAXException.hpp>
10 #include <xercesc/framework/LocalFileFormatTarget.hpp>
22 using namespace XERCES_CPP_NAMESPACE;
29 std::fstream fs(filename.c_str(),
ios::out);
37 DOMImplementation* impl =
38 DOMImplementationRegistry::getDOMImplementation(
fromNative(
"LS").c_str());
40 DOMWriter* writer =
static_cast<DOMImplementationLS*
>(impl)->createDOMWriter( );
41 writer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint,
true);
43 DOMDocumentType* doctype = impl->createDocumentType(
fromNative(
"XML").c_str(), 0, 0 );
47 doc->setEncoding(
fromNative(
"UTF-8").c_str() );
48 doc->setStandalone(
true);
51 DOMElement*
root = doc->getDocumentElement();
61 std::cout <<
"EcalTPGCrystalStatusXMLTranslator::dumpXML" << std::endl;
62 for (
int sign=0; sign <
kSides; sign++) {
63 int thesign = sign==1 ? 1:-1;
67 EBDetId id((ieta+1)*thesign, iphi+1);
68 if(record[
id.rawId()].getStatusCode() > 0) {
79 if(record[
id.rawId()].getStatusCode() > 0) {
static std::string dumpXML(const EcalCondHeader &header, const EcalTPGCrystalStatus &record)
static const int kBarlRings
void WriteNodeWithValue(xercesc::DOMNode *parentNode, const std::string &tag, const T &value)
write a node with
static const int kBarlWedges
static const int kEndcWedgesX
void writeHeader(xercesc::DOMNode *parentNode, const EcalCondHeader &header)
write
const std::string TPGCrystalStatus_tag("EcalTPGCrystalStatus")
static const int MAX_IPHI
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
static const int MAX_IETA
XercesString fromNative(const char *str)
static int writeXML(const std::string &filename, const EcalCondHeader &header, const EcalTPGCrystalStatus &record)
xercesc::DOMElement * writeCell(xercesc::DOMNode *node, const DetId &detid)
Append a Cell node with attributes to.
std::string toNative(const XMLCh *str)
string root
initialization
static const int kEndcWedgesY