Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Bugzilla Id:
      3893

      Description

      Hi,

      I have this problem when using Digester to parse my XML file.
      Suppose we have the following XML structure:

      <parent>
      firstPart
      <child>
      child1
      </child>
      secondPart
      <child>
      child2
      </child>
      lastPart
      </parent>

      The corresponding DTD structure would be:

      <!ELEMENT parent (#PCDATA | child)*>
      <!ELEMENT child (#PCDATA)>

      I saw that the body() method of a Rule object is called only when the end
      of the matching pattern is encountered, and that's why we can only retrieve
      the "lastPart" portion of the <parent> element body, presented in the
      previous example.
      Even more, in such a case, the body() method would receive "child2lastPart"
      as parameter.
      I think this is because we assumed that an element would never have split
      body content like the one I constructed.

      I propose a solution in witch to call the body() method of a rule
      on characters() event of the matching element pattern,
      rather than on endElement(), in order to be able to treat all the body chunks.

      What do you think about this ?

      Thanks!

      Best regards,
      Teodor Danciu

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              teodord@hotmail.com Teodor Danciu
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: