24 unique_ptr<DOMImplementation> domImpl( DOMImplementationRegistry::getDOMImplementation(
qtxml::_toDOMS(
"Range")));
25 if( domImpl ==
nullptr )
return false;
26 theDomWriter = domImpl->createLSSerializer();
27 if( theDomWriter ==
nullptr )
return false;
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 )
return false;
32 theTopElement = theDoc->getDocumentElement();
33 theOutput = domImpl->createLSOutput();
34 if( theOutput ==
nullptr )
return false;
41 theTopElement->appendChild(theDoc->createTextNode(
qtxml::_toDOMS(
"\n")));
43 theTopElement->appendChild(theLastElement);
49 theTopElement->appendChild(theDoc->createTextNode(
qtxml::_toDOMS(
"\n")));
52 theTopElement->appendChild(theLastElement);
59 theLastElement->appendChild(theDoc->createTextNode(
qtxml::_toDOMS(
"\n")));
60 DOMElement* newElement = theDoc->createElement(
qtxml::_toDOMS(tag));
62 theLastElement->appendChild(newElement);
69 theLastElement->appendChild(theDoc->createTextNode(
qtxml::_toDOMS(
"\n")));
70 DOMElement* newElement = theDoc->createElement(
qtxml::_toDOMS(tag));
74 theLastElement->appendChild(newElement);
82 theLastElement->appendChild(theDoc->createTextNode(
qtxml::_toDOMS(
"\n")));
83 DOMElement* newElement = theDoc->createElement(
qtxml::_toDOMS(tag));
87 theLastElement->appendChild(newElement);
97 theLastElement->appendChild(theDoc->createTextNode(
qtxml::_toDOMS(
"\n")));
98 DOMElement* newElement = theDoc->createElement(
qtxml::_toDOMS(tag));
103 theLastElement->appendChild(newElement);
110 XMLFormatTarget* formTarget =
new LocalFileFormatTarget(fname.c_str());
111 theOutput->setByteStream(formTarget);
112 theDomWriter->write(theTopElement, theOutput);
114 theOutput->release();
116 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.