David Cuthill
Fri, 26 Nov 2004 08:35:29 -0800
Hi all,
I would be very gratefully for some help with this.
Thanks David Cuthill
#1 org.infohazard.maverick.util.XML.java ---------------------------------------- public class XML { ...
static
{
// OLD CODE - This method now removed from v1.0 and replaced with
// a Format.TextMode inner class
//outputter.setTextNormalize(true); // NEW CODE outputter.getFormat().setTextMode(Format.TextMode.NORMALIZE); }
#2 org.infohazard.maverick.util.XML.java ---------------------------------------- public static Map getParams(Element node) { ...
if (value == null)
{
/* OLD CODE: Checks for presence of children if no value present
* getChildren() now removed from v1.0
if (paramNode.hasChildren())
value = paramNode.getChildren();
else
value = paramNode.getTextTrim();
*//* NEW CODE: Since this method expects what the name/value pair * param nodes should look like (from this methods javadoc), is there * actually any need to check for child elements? */ value = paramNode.getTextTrim(); }
#3 org.infohazard.maverick.Dispatcher.java ------------------------------------------ protected void reloadConfig() throws ConfigException { ...
public void go(MaverickContext mctx) throws IOException, ServletException
{
// OLD CODE: Sets values for indent, newlines & encoding
// v1.0 jdom added a Format class to control XMLOutputter behavior.
// XMLOutputter outputter = new XMLOutputter(" ", true, "UTF-8"); // NEW CODE: Uses new jdom Format class
// I can't see how to explicitly set newlines=true in Format.
// Would Format.getRawFormat() or Format.getPrettyFormat()
// provide the expected output?
XMLOutputter outputter = new XMLOutputter(
Format.getCompactFormat().setIndent(" ").setEncoding("UTF-8"));