M
mlynch147
Hi
Im trying to write some code that takes an xml string as an input
parameter and from this string create an XML Object, and then using
the attributes of this object, use them to populate one of my
classes... I though it would work something like this....
public static void stringToXML(String xmlString) {
XmlObject xmlObj = XmlObject.Factory.newInstance();
try {
System.out.println("trying to parse xmlObj");
xmlObj = XmlObject.Factory.parse(xmlString);
myClass.setColour(xmlObj.getAttribute("Colour"));
myClass.setSpeed(xmlObj.getAttribute("Speed"));
etc...
But this doesnt seem to work.... can someone offer a bit of help to a
newbie please?
thanks
marty
Im trying to write some code that takes an xml string as an input
parameter and from this string create an XML Object, and then using
the attributes of this object, use them to populate one of my
classes... I though it would work something like this....
public static void stringToXML(String xmlString) {
XmlObject xmlObj = XmlObject.Factory.newInstance();
try {
System.out.println("trying to parse xmlObj");
xmlObj = XmlObject.Factory.parse(xmlString);
myClass.setColour(xmlObj.getAttribute("Colour"));
myClass.setSpeed(xmlObj.getAttribute("Speed"));
etc...
But this doesnt seem to work.... can someone offer a bit of help to a
newbie please?
thanks
marty