From: Jimmy Z. <cra...@co...> - 2006-06-14 06:30:34
|
It can be done let me give an example.. The XML snippet is as follows: <test attr1=3D'val1' attr2 =3D 'val2' /> vn.getRootIndex() will get you the index value of "test" element, which = is=20 root.... say its index is 1; then next few tokens attr1 ---> index value is 2 val1 =3D=3D>index value is 3 attr2 ----> index is 4 val2 =3D=3D> index value is 5 make sure you check for the token type at the given index values using vn.getTokenType(int i).. possible token types are ATTR_VAL, ATTR_NAME, ATTR_NS (for namespace) >How can we find an attribute's value by number? >Like we have VTDNav.getAttrValue(String) >but that gives the value given the key. >What if i dont know the key? >Help!!!!!!!!!!!!!! |