22 unique_ptr<DOMImplementation> domImpl(DOMImplementationRegistry::getDOMImplementation(
qtxml::_toDOMS(
"Range")));
23 if (domImpl ==
nullptr)
25 theDomWriter = domImpl->createLSSerializer();
26 if (theDomWriter ==
nullptr)
28 if (theDomWriter->getDomConfig()->canSetParameter(XMLUni::fgDOMWRTFormatPrettyPrint,
true))
29 theDomWriter->getDomConfig()->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint,
true);
30 theDoc = domImpl->createDocument(
nullptr,
qtxml::_toDOMS(main),
nullptr);
31 if (theDoc ==
nullptr)
33 theTopElement = theDoc->getDocumentElement();
34 theOutput = domImpl->createLSOutput();
35 if (theOutput ==
nullptr)
43 theTopElement->appendChild(theDoc->createTextNode(
qtxml::_toDOMS(
"\n")));
45 theTopElement->appendChild(theLastElement);
51 theTopElement->appendChild(theDoc->createTextNode(
qtxml::_toDOMS(
"\n")));
54 theTopElement->appendChild(theLastElement);
60 theLastElement->appendChild(theDoc->createTextNode(
qtxml::_toDOMS(
"\n")));
61 DOMElement* newElement = theDoc->createElement(
qtxml::_toDOMS(tag));
63 theLastElement->appendChild(newElement);
72 theLastElement->appendChild(theDoc->createTextNode(
qtxml::_toDOMS(
"\n")));
73 DOMElement* newElement = theDoc->createElement(
qtxml::_toDOMS(tag));
77 theLastElement->appendChild(newElement);
88 theLastElement->appendChild(theDoc->createTextNode(
qtxml::_toDOMS(
"\n")));
89 DOMElement* newElement = theDoc->createElement(
qtxml::_toDOMS(tag));
93 theLastElement->appendChild(newElement);
106 theLastElement->appendChild(theDoc->createTextNode(
qtxml::_toDOMS(
"\n")));
107 DOMElement* newElement = theDoc->createElement(
qtxml::_toDOMS(tag));
112 theLastElement->appendChild(newElement);
118 XMLFormatTarget* formTarget =
new LocalFileFormatTarget(fname.c_str());
119 theOutput->setByteStream(formTarget);
120 theDomWriter->write(theTopElement, theOutput);
122 theOutput->release();
124 theDomWriter->release();
void createChildElement(std::string tag, std::string name)
void createElement(std::string tag)
bool init(std::string main)
Write XML file.
~SiStripConfigWriter()
Destructor.
XMLCh * _toDOMS(std::string temp)
void write(std::string fname)
SiStripConfigWriter()
Creator.