commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arshika Mishra <Arshika.Mis...@lntinfotech.com>
Subject [Digester] Problem using recursion in xml rule file
Date Wed, 28 Feb 2007 11:31:55 GMT
Hi!

I am trying to parse an XML file using digester but getting a problem. The 
file has a recursive tag. The format of the file given below:

<dpr-domain name="AircraftPerformances">
                <dpr-data-category name="AircraftClass" 
systemOption="FULLOLDI">
                        <dpr-attribute name="landingSpeed" 
systemOption="HALFOLDI"/>
                        <dpr-data-category name="holdingParameters" 
systemOption="HALFOLDI">
                                <dpr-attribute name="maximumspeed1" 
systemOption="FULLOLDI"/>
                        </dpr-data-category>
                        <dpr-data-category name="turnRate" 
systemOption="FULLOLDI,HALFOLDI">
                                <dpr-attribute name="maximumspeed2" 
systemOption="FULLOLDI"/>
                                <dpr-data-category name="accelerateRate" 
systemOption="HALFOLDI">
                                        <dpr-attribute 
name="maximumspeed21" systemOption="FULLOLDI"/>
                                        <dpr-data-category 
name="descendRate" systemOption="HALFOLDI">
                                                <dpr-attribute 
name="maximumspeed211" systemOption="FULLOLDI"/>
                                        </dpr-data-category>
                                </dpr-data-category>
                        </dpr-data-category>
                </dpr-data-category>
</dpr-domain>

The rule file I have written for this is:
<digester-rules>
        <pattern value="dpr-domain">
        <object-create-rule classname="check.Domain"/>
                <pattern value="*/dpr-data-category">
                        <object-create-rule 
classname="check.DataCategory"/>
                        <set-properties-rule/>
                        <pattern value="dpr-attribute">
                                <object-create-rule 
classname="check.Attribute"/>
                                <set-properties-rule/>
                                <set-next-rule methodname="addAttributes" 
/>
                        </pattern>
                        <set-next-rule methodname="addDataCategory" 
paramtype="check.DataCategory"/> 
                </pattern>
                </pattern> 
</digester-rules>

But this is not working. If the "dpr-domain" tag is removed, then it 
works. Please help me by giving a solution for this problem. 



Regards,
Arshika Mishra



______________________________________________________________________
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message