0
我是火花和編程語言的新手。我需要一些幫助來解析基於每個標籤的XML文件。如何處理XML數據集?
這裏是我的小例子 輸入文件:
XML File:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="myfile.xsl" ?>
<bookstore specialty="novel">
<book style="autobiography">
<author>
<first-name>Joe</first-name>
<last-name>Bob</last-name>
<award>Trenton Literary Review Honorable Mention</award>
</author>
<price>12</price>
</book>
</bookstore>
XPATH for above file:
/bookstore[@specialty="novel"]/book[@style="autobiography"]/price
/bookstore[@specialty="novel"]/book[@style="autobiography"]/author
/bookstore[@specialty="novel"]/book[@style="autobiography"]
/bookstore[@specialty="novel"]
現在我想讀的XPath和解析基於每個標籤(bookstore.txt,book.txt,author.txt)
文件Bookstore.txt:
UUID= 1233455 (onfly have to create)
specialty="novel"
Book.txt:
UUID= 1233455 (coming from bookstore)
style="autobiography"
<price>12</price>
Author.txt:
UUID= 9876534(onfly generate and link to book file)
<first-name>Joe</first-name>
<last-name>Bob</last-name>
<award>Trenton Literary Review Honorable Mention</award>
可以請一些一個可以幫助我一下吧。
預先感謝您..
請閱讀[提問指南](https://stackoverflow.com/help/asking)。您應該首先嚐試自己解決問題,表明您已經嘗試搜索並**提供您迄今爲止擁有的任何代碼**。你不能只是陳述問題並要求準備好使用解決方案。 – laughedelic