In-Line XML Editor

From NovaOrdis Knowledge Base
Revision as of 05:24, 11 November 2016 by Ovidiu (talk | contribs) (Ovidiu moved page MutableXMLDocument to In-Line XML Editor without leaving a redirect)
Jump to navigation Jump to search

Internal

Overview

MutableXMLDocument is an API that applies in-line configuration modifications in XML files.

A typical usage pattern is the following:

File file = ...;
MutableXMLDocument d = new MutableXMLDocument(file);

boolean changeOccurred = d.set("/path/in/document", "value");

if (changeOccurred) {

    d.write();
}
else {

  //
  // the value we're trying to set is identical with the value present in the file, react accordingly 
  //
  
}

The modification preserves the original format, nothing is modified except the value that is being changed.