name.alessiosaltarin.utils
Class XMLModifier

java.lang.Object
  extended by name.alessiosaltarin.utils.XMLModifier

public class XMLModifier
extends java.lang.Object

Modify and save nodes in XML files


Constructor Summary
XMLModifier(java.lang.String xmlFilePath)
          Construct a DOM Document reading and parsing xmlFilePath
 
Method Summary
 java.lang.String getNodeValue(java.lang.String tagname)
          Get a specific node value.
static void main(java.lang.String[] args)
          Deprecated.  
 void saveXML()
          Saves a DOM document into the physical XML file.
 void setNodeValue(java.lang.String tagname, java.lang.String newvalue)
          Set a new value for the specific element named with tagname
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLModifier

public XMLModifier(java.lang.String xmlFilePath)
Construct a DOM Document reading and parsing xmlFilePath

Parameters:
xmlFilePath - XML File to modify
Method Detail

getNodeValue

public java.lang.String getNodeValue(java.lang.String tagname)
Get a specific node value. If tag has more than one child, the first one is returned.

Parameters:
tagname -
Returns:
XML Node Value

setNodeValue

public void setNodeValue(java.lang.String tagname,
                         java.lang.String newvalue)
Set a new value for the specific element named with tagname

Parameters:
tagname - The name of the XML node to change
newvalue - New value for the element

saveXML

public void saveXML()
Saves a DOM document into the physical XML file.


main

public static void main(java.lang.String[] args)
Deprecated. 

For test purposes only.

Parameters:
args - arguments

Jurpe - Java Universal Role Playing Engine - http://jurpe.sourceforge.net