1

我有以下 XML

<Messages>
<PopUpMessages>
<Message no=”1” type=”game” name=”DONATION”&gt;
Congratulation You won
</Message>
</PopUpMessages>

我正在使用这个http://code.google.com/p/asaxb/,它用于 Actionscript,它具有 JAXB 的基本功能。

问题是我可以获得 PopUpMessages,一切都很好,但我无法获得消息内的内容
“Congratulation You Won”

定义是:

    package
    { 
    [XmlRootNode(name = 'Message')]
    public class Message {

        [XmlAttribute(name = "no")]
        public var no:Number;
        [XmlAttribute(name = "type")]
        public var type:String;
        [XmlAttribute(name = "imageSource")]
        public var imageSource:String;
        [XmlAttribute(name = "name")]
        public var name:String;
        [XmlAttribute(name = "k")]
        public var k:String;
    }    
    }

   // The class that I unmarsahall 
    public class GCPResponse {      
        [XmlElement(name="Messages")]
        public var message:Messages;    
    }

    package
    { 
    [XmlRootNode(name = "PopUpMessages")]
    public class PopUpMessages {

        [XmlElement(name="Message")]

        public var  message:Message;     
    }
    }
4

1 回答 1

0

您需要利用@XmlValue注释。

于 2013-07-16T10:05:52.650 回答