Commons Digester
  1. Commons Digester
  2. DIGESTER-9

Digester DTD does not provide a SetRootRule element

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: 1.6
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

      Description

      In "public void addRuleInstances(Digester digester)" in
      org.apache.commons.digester.xmlrules.DigesterRuleParser add:

      digester.addFactoryCreate("*/set-root-rule", new SetRootRuleFactory());
      digester.addRule("*/set-root-rule", new PatternRule("pattern"));
      digester.addSetNext("*/set-root-rule", "add", ruleClassName);

      and create the following inner class in
      org.apache.commons.digester.xmlrules.DigesterRuleParser

      protected class SetRootRuleFactory extends AbstractObjectCreationFactory {
      public Object createObject(Attributes attributes)

      { String methodName = attributes.getValue("methodname"); String paramType = attributes.getValue("paramtype"); return (paramType == null || paramType.length() == 0) ? new SetRootRule( methodName) : new SetRootRule( methodName, paramType); }

      }

      And this bug is over !
      Thanks

        Activity

        Hide
        George Gastaldi added a comment -

        Forgot to mention: The DTD must be updated also !

        Show
        George Gastaldi added a comment - Forgot to mention: The DTD must be updated also !
        Hide
        George Gastaldi added a comment -

        Update DTD with this:

        <!-- SetRootRule -->
        <!ELEMENT set-root-rule EMPTY>
        <!ATTLIST set-root-rule
        pattern CDATA #IMPLIED
        methodname CDATA #REQUIRED
        paramtype CDATA #IMPLIED>

        Show
        George Gastaldi added a comment - Update DTD with this: <!-- SetRootRule --> <!ELEMENT set-root-rule EMPTY> <!ATTLIST set-root-rule pattern CDATA #IMPLIED methodname CDATA #REQUIRED paramtype CDATA #IMPLIED>
        Hide
        Craig McClanahan added a comment -

        Fixed in nightly build 20040215. Thanks for the patches!

        Show
        Craig McClanahan added a comment - Fixed in nightly build 20040215. Thanks for the patches!

          People

          • Assignee:
            Unassigned
            Reporter:
            George Gastaldi
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development