xmlbeans.jar newbie question

Discussion in 'XML' started by mlynch147, Jul 17, 2007.

  1. mlynch147

    mlynch147 Guest

    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
    mlynch147, Jul 17, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arnold Peters
    Replies:
    0
    Views:
    555
    Arnold Peters
    Jan 5, 2005
  2. muttley
    Replies:
    0
    Views:
    2,696
    muttley
    Oct 20, 2005
  3. cyberco
    Replies:
    4
    Views:
    3,729
    Roedy Green
    Feb 14, 2006
  4. Replies:
    0
    Views:
    330
  5. mlynch147

    xmlbeans.jar newbie question

    mlynch147, Jul 17, 2007, in forum: XML
    Replies:
    1
    Views:
    444
    Joe Kesselman
    Jul 17, 2007
Loading...

Share This Page