请教lr_xml_find函数问题
本帖最后由 Heaices 于 2012-3-8 13:47 编辑请教高手,我查找字符串“可爱多”时,使用lr_xml_find进行查找,代码如下:
char *xml_input = "<?xml version=""1.0"" encoding=""UTF-8"" ?><AMFPacket AMF_version=""3""><AMFHeaders/><Messages><Message method=""/3/onResult"" target=""><AMF3><object-externalizable-custom><flex.messaging.messages.AcknowledgeMessageExt>"
"<byte>-95</byte>"
"<byte>3</byte>"
"<com.xxx.system.user.model.MngUserV>"
"<userId>2293</userId>"
"<userNo>keaiduo</userNo>"
"<userName>可爱多</userName>"
"<validtyFlag>Y</validtyFlag>"
"<deptId>0</deptId>"
"<tel>13900000001</tel>"
"<EMail>keaiduo@gd.chinamobile.com</EMail>"
"<description>1111</description>"
"<encPwd>96e79218965eb72c92a549dd5a330112</encPwd>"
"<employeeId>0</employeeId>"
"<lastUpdateDate>2012-01-31 15:44:43.0 CST</lastUpdateDate>"
"<lastUpdatedBy>0</lastUpdatedBy>"
"<createdBy>0</createdBy>"
"<lastUpdateLogin>0</lastUpdateLogin>"
"<enabledFlag>Y</enabledFlag>"
"<dgSelected>false</dgSelected>"
"</com.xxx.system.user.model.MngUserV>"
"<long>1331182388781</long>"
"<byte-array>sIhiLM0MUnx00fEF1qQkkg==</byte-array>"
"<byte-array>sIhiU90LjDaSFMyILrQZ3Q==</byte-array>"
"<byte>1</byte>"
"<string>7WHFZFGJ-NHVR-12CV-JEUN-0W4DUX1903G0</string>"
"<byte>0</byte>"
"</flex.messaging.messages.AcknowledgeMessageExt></object-externalizable-custom></AMF3></Message></Messages></AMFPacket>";
Action() {
int find_cnt;
lr_save_string(xml_input,"XML_Input_Param");
find_cnt = lr_xml_find("XML={XML_Input_Param}",
"Value=可爱多",
"Query=/AMFPacket/Messages/Message/AMF3/object-externalizable-custom/flex.messaging.messages.AcknowledgeMessageExt/com.xxx.system.user.model.MngUserV",
LAST );
return 0;
}
但是运行结果提示:
Action.c(92): Error: Expected quoted string (line 1, col 15)
Action.c(92): Error: "lr_xml_find" execution failed
我加了打印信息上去后,发现lr_save_string函数没有把值给XML_Input_Param参数,请教这里该如何处理?
再者,lr_xml_find函数是否正确,谢谢! 把你的char *定义丢到action里面去
lr_xml_find函数记得不是很清楚了,只要你后面的查询节点对了就行了,不应该有太多问题
页:
[1]