-- 作者:ben1126
-- 发布时间:5/10/2005 12:51:00 PM
-- 怎样用JAVA把html中的xml数据解析出来?
有如下的html和xml文件,怎么把html文件中的xml文件名提取出来,然后到xml文件中提取数据啊? <!--File Name:Inventory Big Table.htm --> <HTML> <HEAD> <TITLE>Book Inventory</TITLE> </HEAD> <BODY> <XML ID="dsoInventory" SRC="Inventory Big.xml"></XML> <H2>Book Inventory</H2> <BUTTON ONCLICK="InventoryTable.firstPage()"> |<First Page </BUTTON> <BUTTON ONCLICK="InventoryTable.previousPage()"> <Previous Page </BUTTON> <BUTTON ONCLICK="InventoryTable.nextPage()"> Next Page > </BUTTON> <BUTTON ONCLICK="InventoryTable.lastPage()"> Last Page >| </BUTTON> <p> <TABLE ID="InventoryTable" DATASRC="#dsoInventory" DATAPAGESIZE="5" BORDER="1" CELLPADDING="5"> <THEAD> <TH>Title</TH> <TH>Author</TH> <TH>Binding</TH> <TH>Pages</TH> <TH>Price</TH> </THEAD> <TR ALIGN="center"> <TD><SPAN DATAFLD="TITLE "></SPAN></TD> <TD><SPAN DATAFLD="AUTHOR"></SPAN></TD> <TD><SPAN DATAFLD="BINDING"></SPAN></TD> <TD><SPAN DATAFLD="PAGES"></SPAN></TD> <TD><SPAN DATAFLD="PRICE"></SPAN></TD> </TR> </TABLE> </BODY> <?xml version="1.0"?> <!--File Name:Inventory Big.xml --> <INVENTORY> <BOOK> <TITLE>The Adventures of Huckleberry Finn</TITLE> <AUTHOR>Mark Twain</AUTHOR> <BINDING>mass market paperback</BINDING> <PAGES>298</PAGES> <PRICE>$5.49</PRICE> </BOOK> <BOOK> <TITLE>The Adventures of Tom Sawyer</TITLE> <AUTHOR>Mark Twain</AUTHOR> <BINDING>mass market paperback</BINDING> <PAGES>205</PAGES> <PRICE>$4.75</PRICE> </BOOK> <BOOK> <TITLE>The Ambassadors</TITLE> <AUTHOR>Henry James</AUTHOR> <BINDING>mass market paperback</BINDING> <PAGES>305</PAGES> <PRICE>$5.95</PRICE> </BOOK> <BOOK> <TITLE>The Awakening</TITLE> <AUTHOR>Kate Chopin</AUTHOR> <BINDING>mass market paperback</BINDING> <PAGES>195</PAGES> <PRICE>$4.95</PRICE> </BOOK> <BOOK> <TITLE>Billy Budd</TITLE> <AUTHOR>Herman Melville</AUTHOR> <BINDING>mass market paperback</BINDING> <PAGES>195</PAGES> <PRICE>$4.49</PRICE> </BOOK> <BOOK> <TITLE>A Connecticut Yankee in King Arthur's Court</TITLE> <AUTHOR>Mark Twain</AUTHOR> <BINDING>mass market paperback</BINDING> <PAGES>385</PAGES> <PRICE>$5.49</PRICE> </BOOK> <BOOK> <TITLE>Joan of Arc</TITLE> <AUTHOR>Mark Twain</AUTHOR> <BINDING>trade paperback</BINDING> <PAGES>465</PAGES> <PRICE>$6.95</PRICE> </BOOK> <BOOK> <TITLE>Leaves of Grass</TITLE> <AUTHOR>Walt Whitman</AUTHOR> <BINDING>hardcover</BINDING> <PAGES>462</PAGES> <PRICE>$7.75</PRICE> </BOOK> <BOOK> <TITLE>The Legend of Sleepy Hollow</TITLE> <AUTHOR>Washington Irving</AUTHOR> <BINDING>mass market paperback</BINDING> <PAGES>98</PAGES> <PRICE>$2.95</PRICE> </BOOK> <BOOK> <TITLE>The Marble Faun</TITLE> <AUTHOR>Nathaniel Hawthorne</AUTHOR> <BINDING>trade paperback</BINDING> <PAGES>473</PAGES> <PRICE>$10.95</PRICE> </BOOK> <BOOK> <TITLE>Moby-Dick</TITLE> <AUTHOR>Herman Melville</AUTHOR> <BINDING>hardcover</BINDING> <PAGES>724</PAGES> <PRICE>$9.95</PRICE> </BOOK> <BOOK> <TITLE>Passing</TITLE> <AUTHOR>Nella Larsen</AUTHOR> <BINDING>trade paperback</BINDING> <PAGES>165</PAGES> <PRICE>$5.95</PRICE> </BOOK> <BOOK> <TITLE>The Portrait of a Lady</TITLE> <AUTHOR>Henry James</AUTHOR> <BINDING>mass market paperback</BINDING> <PAGES>256</PAGES> <PRICE>$4.95</PRICE> </BOOK> <BOOK> <TITLE>Roughing It</TITLE> <AUTHOR>Mark Twain</AUTHOR> <BINDING>mass market paperback</BINDING> <PAGES>324</PAGES> <PRICE>$5.25</PRICE> </BOOK> <BOOK> <TITLE>The Scarlet Letter</TITLE> <AUTHOR>Nathaniel Hawthorne</AUTHOR> <BINDING>trade paperback</BINDING> <PAGES>253</PAGES> <PRICE>$4.25</PRICE> </BOOK> <BOOK> <TITLE>The Turn of the Screw</TITLE> <AUTHOR>Henry James</AUTHOR> <BINDING>trade paperback</BINDING> <PAGES>384</PAGES> <PRICE>$3.35</PRICE> </BOOK> </INVENTORY>
|