jyu
04-10-2003, 04:01 AM
Hello, guys, any one knows how to use XML.sendandload with a Java servlet.
Say, I have following code in my flash movie:
"sendXml = new XML("<p>Dog</P>");//create the send xml object
eventXml=new XML();
eventXml.ignoreWhite = true;//take care of white space, which may interfere with
//your reading of the xml otherwise
eventXml.onLoad = function(cool)//here,no matter what variable name you will use
//the variable is always set to a boolean value
{
if(cool){
//this toString() gives you the contents of the xml file in string format
//trace(this.toString());
eventItem = this.firstChild.childNodes;//our xml file is pretty simple
//with only one child,but this child has three children
//processing xml
//......blah blah blah
}//end of if(cool)
}//end of onload function
//the call to load method is always put at this postion, after we define
//the onload method
sendXml.sendAndLoad("http://degas.ecom.arizona.edu:5081/JiaoYu/servlet/Hello6",eventXml);//name of our xml file, in the same folder as this fla "
If I want to parse the xml part sent to the servlet, i.e. "<p>dog</p>", how can I do it in the servlet?
Thanks so much.
Say, I have following code in my flash movie:
"sendXml = new XML("<p>Dog</P>");//create the send xml object
eventXml=new XML();
eventXml.ignoreWhite = true;//take care of white space, which may interfere with
//your reading of the xml otherwise
eventXml.onLoad = function(cool)//here,no matter what variable name you will use
//the variable is always set to a boolean value
{
if(cool){
//this toString() gives you the contents of the xml file in string format
//trace(this.toString());
eventItem = this.firstChild.childNodes;//our xml file is pretty simple
//with only one child,but this child has three children
//processing xml
//......blah blah blah
}//end of if(cool)
}//end of onload function
//the call to load method is always put at this postion, after we define
//the onload method
sendXml.sendAndLoad("http://degas.ecom.arizona.edu:5081/JiaoYu/servlet/Hello6",eventXml);//name of our xml file, in the same folder as this fla "
If I want to parse the xml part sent to the servlet, i.e. "<p>dog</p>", how can I do it in the servlet?
Thanks so much.