commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raymond Lukas" <rlu...@cadence.com>
Subject Trigger method call on an end Tag
Date Fri, 21 Feb 2003 16:28:14 GMT
Please if someone could give me a hand. How do I trigger a method call
when I hit the </Tag>.. In the small example below I am looking to nest
List elements in a document generation system. If I could just detect
and trigger a method call on the </List> I would be all set. I read the
manual but it did not help me out enough. An example on the other hand
would be GREAT!! This is an important project and I really need someone
to take a few minutes and post an example or a pointer to an example... 

 

 

 

I need to handle nesting element inside of my XML file.. Something like
this:

      <HeaderLevel1 headerName = "Diva DRC">

            <List type = "numbered">

                  <Entry name="OutterA">                      

                        <List type = "dotted">                    

                              <Entry name=" InnerA ">

                              </Entry>

                              <Entry name=" InnerB ">

                              </Entry>

                        </List>

                  </Entry>                

                  <Entry name="Outter">                       

                        <List type = "dotted">                    

                              <Entry name="InnerA">

                              </Entry>

                              <Entry name="InnerB">

                              </Entry>

 

                        </List>

                  </Entry>                                  

            </List>

      </HeaderLevel1>

      

 

Inside of my Digest setup I have something like this. Well exactly like
this. Everything is call fine, I just need to know when I am at the end
of each List Element.. 

 

        Class listClass = ListElement.class;

        digester.addObjectCreate("*/List", listClass);

        digester.addSetProperties("*/List"); 

        //digester.addCallMethod("Section/HeaderLevel1/List/Entry",
"addInnerListEntry");                         

 

        //      --------------------------------------

         Class entryClass = Entry.class;

         digester.addObjectCreate("*/List/Entry", entryClass);

         digester.addSetProperties("*/List/Entry"); 

         digester.addSetNext("*/List/Entry", "addEntry");  


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