22 }
catch (
const XMLException &toCatch) {
23 cout <<
"Problem to initialise XML !!! " << endl;
26 unique_ptr<DOMImplementation> domImpl(DOMImplementationRegistry::getDOMImplementation(
qtxml::_toDOMS(
"Range")));
27 if (domImpl ==
nullptr)
29 theDomWriter = domImpl->createLSSerializer();
30 if (theDomWriter ==
nullptr)
32 if (theDomWriter->getDomConfig()->canSetParameter(XMLUni::fgDOMWRTFormatPrettyPrint,
true))
33 theDomWriter->getDomConfig()->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint,
true);
34 theDoc = domImpl->createDocument(
nullptr,
qtxml::_toDOMS(
"Layouts"),
nullptr);
35 if (theDoc ==
nullptr)
37 theTopElement = theDoc->getDocumentElement();
38 theTopElement->appendChild(theDoc->createTextNode(
qtxml::_toDOMS(
"\n")));
39 theOutput = domImpl->createLSOutput();
40 if (theOutput ==
nullptr)
50 theTopElement->appendChild(theLastLayout);
56 theLastLayout->appendChild(theDoc->createTextNode(
qtxml::_toDOMS(
"\n")));
59 theLastLayout->appendChild(theLastRow);
60 theLastLayout->appendChild(theDoc->createTextNode(
qtxml::_toDOMS(
"\n")));
66 theLastRow->appendChild(theDoc->createTextNode(
qtxml::_toDOMS(
"\n")));
68 theLastRow->appendChild(e1);
78 XMLFormatTarget *formTarget =
new LocalFileFormatTarget(fname.c_str());
79 theOutput->setByteStream(formTarget);
80 theDomWriter->write(theTopElement, theOutput);
84 theDomWriter->release();
bool init()
Write XML file.
~SiPixelConfigWriter()
Destructor.
SiPixelConfigWriter()
Creator.
void write(std::string &fname)
void createColumn(std::string &element, std::string &name)
XMLCh * _toDOMS(std::string temp)
void createLayout(std::string &name)