hi everybody
i want to parse an XML file with xerces Dom parser but could not succeed here is code for my xml file which i have to change
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
all i want to change the <value> name </value> to <value>next></value>
in the file how to do this?
i wrote a c++ dom parser code also but can't change the parameter my c++ code is following:
#include<string.h>
#include<iostream>
#include<sstream>
#include<sys/types.h>
#include<unistd.h>
#include<errno.h>
#include<sys/stat.h>
#include "parser1.hpp"
using namespace xercesc ;
using namespace std;
if ( root ) {
cout<<"hi";
DOMElement* property = dynamic_cast<DOMElement*>( root->getElementsByTagName(XMLString::transcode( "property")));
if ( property )
{
DOMElement* value = dynamic_cast<DOMElement*>( property->getElementsByTagName(XMLString::transcode("value")) );
if ( value )
{ cout<<XMLString::transcode(value->getTextContent());
value->setTextContent( XMLString::transcode(" next") ); // this will update the element named "value"
}
}
}