51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 2412|回复: 1
打印 上一主题 下一主题

[原创] 如何读取XML 某一node里部分内容?

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2008-4-7 11:07:39 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
我们要测的应用程序要给用户的eMail里Notification.
This messsage is kept by XML data.
There is a registeration link in one node in this me?message.
How can I get this link?
Now I can imulately open this eMail in "app/eMails" URL.
This message format is as below:

<MANIFEST>
  <SOURCE />
  <SOURCE_TYPE>1</SOURCE_TYPE>
  <PRIORITY>0</PRIORITY>
  <MESSAGE_KEY />
  <MESSAGE_TYPE>Email Queue Message</MESSAGE_TYPE>
  <DATETIME_STAMP>3/19/2008 6:08:23 PM</DATETIME_STAMP>
  </MANIFEST>
<PAYLOAD>
<TRANSPORT_DETAILS>
  <TO_ADDRESS>"pandita1 P. napat1" <adipol@yah.com></TO_ADDRESS>
  <FROM_ADDRESS>"add update10" <support@xxxx.com></FROM_ADDRESS>
  <CC_ADDRESS />
  <SUBJECT>Invitation from your Doctor to Communicate Online</SUBJECT>
  <BODY_FORMAT>0</BODY_FORMAT>
  <SENDER_NAME />
  <RECIPIENT_NAME />
  </TRANSPORT_DETAILS>
  <MESSAGE_CONTENT>Dear pandita1 P. napat1, You may now reach me online using a secure service called xxx. I encourage you to communicate with me directly about non-urgent healthcare needs. I have set up an account on your behalf. To complete registration for this account, please click the link below. https://app.xxxx/Invite/PIMgr.aspx?token=1712BBA52D85DA Please click this link or paste it into your browser's address field. .... Learn more (take a tour). https://app.xxxx/general/onlineQuicktour/default.aspx NOTE: PLEASE DO NOT REPLY TO THIS INVITATION E-MAIL. REGISTER FOR THE SECURE SERVICE TO COMMUNICATE ONLINE WITH ME. Sincerely, add update10 If you would like to decline this invitation please click: https://app.xxxx/Invite/PIMgr.aspx?decline=1712BBA52D85DA</MESSAGE_CONTENT>
  </PAYLOAD>

数据如上所述,我要如何取得蓝色的URL Address?
任务比较急,自己以前也没接触过,请知道的朋友给点Idea. thanks

[ 本帖最后由 Grace 于 2008-4-7 11:10 编辑 ]
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2008-4-7 12:12:53 | 只看该作者
任何编程语言都行吧
先用个xml parser的包,dom什么的,弄出那个MESSAGE_CONTENT的node,
然后可以用regular expression,你自己找些特征,不会混淆的就好。
我个人建议用ruby,相当简单,remxl也比一般dom简单多了。
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-11-9 00:41 , Processed in 0.073109 second(s), 28 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表