question: public static void substituteProperties ( Node node , Properties properties ) { Node child ; Node next = node . getFirstChild ( ) ; while ( ( child = next ) != null ) { next = child . getNextSibling ( ) ; if ( child . getNodeType ( ) == Node . TEXT_NODE ) { child . setNodeValue ( PropertiesUtil . substituteProperty ( child . getNodeValue ( ) , properties ) ) ; } else if ( child . getNodeType ( ) == Node . ELEMENT_NODE ) { NamedNodeMap attributes = child . getAttributes ( ) ; for ( int i = 0 ; i < attributes . getLength ( ) ; i ++ ) { Node attribute = attributes . item ( i ) ; attribute . setNodeValue ( PropertiesUtil . substituteProperty ( attribute . getNodeValue ( ) , properties ) ) ; } substituteProperties ( child , properties ) ; } } }
target:  Replaces ${property[:default value]} references in all attributes and text nodes of supplied node.  If the property is not defined neither in the given Properties instance nor in System.getProperty and no default value is provided, a runtime exception is thrown.