[jdom-interest] java.lang.Verify error : getting data from JDOM element

Emmett McLean emmettwa at onebox.com
Mon Sep 16 11:06:08 PDT 2002


Hi,

Could someone show me how to get the value 2 out of the element elm?

Various permutations of the following result in a java.lang.Verify error.

Thanks,

em

import org.jdom.*;
import org.jdom.output.*;

public class C {
    C() {}

    public static void go() {
        Element elm = new Element("one");
        elm.addContent(new Element("two").addContent("2"));
        try {
            String c = elm.getChildText("two");
            System.out.println( " 2 = " + c);
        } catch ( Exception ex ) {
            System.out.println("didn't get it");
        }
    }

    public static void main(String args[] )
    {
        (new B()).go();
    }
}


-- 
Emmett McLean
emmettwa at onebox.com - email
(866) 841-9139 x1160 - voicemail/fax

 



More information about the jdom-interest mailing list