commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Calvin R Smith (JIRA)" <j...@apache.org>
Subject [jira] Created: (DIGESTER-129) Handle xml with duplicate xpath
Date Mon, 29 Sep 2008 17:32:44 GMT
Handle xml with duplicate xpath
-------------------------------

                 Key: DIGESTER-129
                 URL: https://issues.apache.org/jira/browse/DIGESTER-129
             Project: Commons Digester
          Issue Type: Improvement
            Reporter: Calvin R Smith
            Priority: Minor


I have an xml file where I want the same xpath pattern to goto different objects
ie:

<pattern value="abc">
      <object-create-rule classname="def" />
      <set-next-rule methodname="add" />
      <bean-property-setter-rule pattern="def" propertyname="def" />
</pattern>
<pattern value="abc">
      <object-create-rule classname="xyz" />
      <set-next-rule methodname="add" />
      <bean-property-setter-rule pattern="xyz" propertyname="xyz" />
</pattern>

Currently digester will collapse this like so:
<pattern value="abc">
      <object-create-rule classname="def" />
      <object-create-rule classname="xyz" />
      <set-next-rule methodname="add" />
      <set-next-rule methodname="add" />
      <bean-property-setter-rule pattern="def" propertyname="def" />
      <bean-property-setter-rule pattern="xyz" propertyname="xyz" />
</pattern>

making this impossible.

My current work-around is to expose the parent count property so I have:

<pattern value="abc">
      <object-create-rule classname="def" />
      <set-next-rule methodname="add" />
      <bean-property-setter-rule pattern="def" propertyname="def" parentcount="1" />
</pattern>
<pattern value="abc">
      <object-create-rule classname="xyz" />
      <set-next-rule methodname="add"  parentcount="2" />
      <bean-property-setter-rule pattern="xyz" propertyname="xyz" />
</pattern>

I can submit a path for this or we can discuss more cleaner solutions

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message