From: Jimmy Z. <cra...@co...> - 2006-09-05 18:26:07
|
Suppose the element has N attributes and the element's VTD index is i i =3D=3D> element i + 1 =3D=3D> attribute name i+2 =3D=3D=3D > attribute val i+3 =3D=3D=3D> attribute name i+4 =3D=3D=3D> attribute val .... i + 2N =3D=3D> attribute name i+2N+1 =3D=3D>attribute val.... so you can do something like that when using VTD-XML int i=3D vn.getCurrentIndex(); while(int j=3D0; j<vn.getAttrCount() ; j++){ System.out.println(" attr name --->"+ vn.toString(i+2j+1)); System.out.println(" attr val --->" + vn.toString(i+2j+2)); } ----- Original Message -----=20 From: Olusola Fadero=20 To: vtd...@li...=20 Sent: Tuesday, September 05, 2006 4:38 AM Subject: [Vtd-xml-users] Getting Attibutes names out of an element Hi ,=20 I've been looking at VTD-XML with interest . One thing I don't = understand is how do I get the names of attributes out of an element if = I don't know all the attribute names. In other Java API's there is a way = of getting a list of attributes for an element i.e. by using a Nodelist. Olusola -------------------------------------------------------------------------= ----- = -------------------------------------------------------------------------= Using Tomcat but need to do more? Need to support web services, = security? Get stuff done quickly with pre-integrated technology to make your job = easier Download IBM WebSphere Application Server v.1.0.1 based on Apache = Geronimo = http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D= 121642 -------------------------------------------------------------------------= ----- _______________________________________________ Vtd-xml-users mailing list Vtd...@li... https://lists.sourceforge.net/lists/listinfo/vtd-xml-users |