public static void saveCategory(Target target)
    {
        String s = target.getNewTopic();
        String s1 = target.getNewThat();
        boolean flag;
        if(s == null)
            flag = false;
        else
        if(s.trim().length() == 0 || s.equals("*"))
            flag = false;
        else
            flag = true;
        boolean flag1;
        if(s1 == null)
            flag1 = false;
        else
        if(s1.trim().length() == 0 || s1.equals("*"))
            flag1 = false;
        else
            flag1 = true;
        if(!flag)
        {
            XMLWriter.write("    <category>" + Targeting.LINE_SEPARATOR + "    " + "    " + "<pattern>" + target.getNewPattern() + "</pattern>" + Targeting.LINE_SEPARATOR, AIML_RESOURCE);
            if(flag1)
                XMLWriter.write("        <that>" + s1 + "</that>" + Targeting.LINE_SEPARATOR, AIML_RESOURCE);
            XMLWriter.write("        <template>" + Targeting.LINE_SEPARATOR + "    " + "    " + "    " + target.getNewTemplate() + Targeting.LINE_SEPARATOR + "    " + "    " + "</template>" + Targeting.LINE_SEPARATOR + "    " + "</category>" + Targeting.LINE_SEPARATOR, AIML_RESOURCE);
        } else
        {
            XMLWriter.write("    <topic name=\"" + s + "\">" + Targeting.LINE_SEPARATOR + "    " + "    " + "<category>" + Targeting.LINE_SEPARATOR + "    " + "    " + "    " + "<pattern>" + target.getNewPattern() + "</pattern>" + Targeting.LINE_SEPARATOR, AIML_RESOURCE);
            if(flag1)
                XMLWriter.write("            <that>" + s1 + "</that>" + Targeting.LINE_SEPARATOR, AIML_RESOURCE);
            XMLWriter.write("            <template>" + Targeting.LINE_SEPARATOR + "    " + "    " + "    " + "    " + target.getNewTemplate() + Targeting.LINE_SEPARATOR + "    " + "    " + "    " + "</template>" + Targeting.LINE_SEPARATOR + "    " + "    " + "</category>" + Targeting.LINE_SEPARATOR + "    " + "</topic>" + Targeting.LINE_SEPARATOR, AIML_RESOURCE);
        }
        save(target);
    }