JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » Java & XML、Web Service  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友    訂閱主題
reply to topicthreaded modego to previous topicgo to next topic
本主題所含的標籤
無標籤
作者 JDOM中的XPath
garbage

以死美工自居



發文: 65
積分: 0
於 2003-07-23 09:15 user profilesend a private message to usersend email to garbagereply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我抓了JDom beta 9
裡面似乎有一個XPath的API可以用,不過哩,不曉得為什麼,每次我用的時候都會造成IOException...

有沒有人成功的使用過XPath呢?
另外還有一個Filter,有誰知道該如何使用嗎?

先謝謝回答的好心人...


reply to postreply to post
作者 Re:JDOM中的XPath [Re:garbage]
browser

戀香

版主

發文: 3570
積分: 1
於 2003-07-23 09:29 user profilesend a private message to usersend email to browserreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
garbage wrote:
我抓了JDom beta 9
裡面似乎有一個XPath的API可以用,不過哩,不曉得為什麼,每次我用的時候都會造成IOException...

有沒有人成功的使用過XPath呢?
另外還有一個Filter,有誰知道該如何使用嗎?

先謝謝回答的好心人...


先張貼一下 程式碼 和 error message 吧 ....
JDom 的 XPath .. 我記得是蠻好用、方便的工具 .....


reply to postreply to post
作者 Re:JDOM中的XPath [Re:garbage]
ray_linn

什么都不懂的小白

版主

發文: 540
積分: 10
於 2003-07-23 12:14 user profilesend a private message to usersend email to ray_linnreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
大概是load xml的時候齣錯樂....

醬紫load一個xml:

Document doc = builder.build(new File(filename));

醬紫初始化一個XPath

XPath myPath = XPath.newInstance("//someXPathExpress");

然后抓所有的nodes.

List myNodes = myPath.selectNodes(doc);

接下來就是例行公事......


reply to postreply to post
飞翔的候鸟
作者 Re:JDOM中的XPath [Re:ray_linn]
garbage

以死美工自居



發文: 65
積分: 0
於 2003-07-23 21:31 user profilesend a private message to usersend email to garbagereply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
哈哈,搞定啦...
原來是我沒有saxpath的api...


reply to postreply to post
» JWorld@TW »  Java & XML、Web Service

reply to topicthreaded modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8