File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes convert Vector to xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "convert Vector to xml" Watch "convert Vector to xml" New topic

convert Vector to xml

peter brews
Ranch Hand

Joined: Jan 25, 2002
Posts: 59
Input will be vector whose each element will itself be a vector.Length of vector of each element may vary for different calls.Only the selected element needs to be placed in proper order in the output.For ex. field2 is not required in the output.Also field4 is placed before field3.Below is the code that I tried to write.Can any one help me with better solution.

The Input is vector :
"[ [field1,f1_val1,f1_val2,f1_val3,f1_val4] ,[field2,f2_val1,f2_val2,f2_val3,f2_val4],
,[field4,f4_val1,f4_val2]] )

Expected output is :
< FIELD Row=1>
< FIELD Row=2>
< FIELD Row=3>
< FIELD Row=4>
< FIELD Row=5>

edited by Dave to put the code in the UBB code tags.
[ February 27, 2002: Message edited by: Dave Vick ]
[ February 27, 2002: Message edited by: smita agarnal ]
I agree. Here's the link:
subject: convert Vector to xml
It's not a secret anymore!