I am passing a a full XML representation as a string between two programs, Please how steps do i need to "cast" the String to an XML Element
Joined: Nov 11, 2003
When you say "cast" it implies that an xml element is a java type. I may be wrong but, in my experience, I always create an XML just like you'd create a String (appending tags and values as needed). I usually have all the values as fields in a class (CMRAll in my example) so I can loop through all the fields to create the element names and values using the Class class in a method I call "xmlIt". The result is a String with the entire xml structure, like this:
I'm willing to listen to someone with a better idea since I am relatively new to creating xml from my code.
Joined: Mar 01, 2007
Have a look at JDom. It's a very simple XML DOM API (Man that's a lot af TLA's )