1
一個XML文件,我需要在C#來解析XML文件...該文件將看一些這樣的事....解析在C#
- <book>
<rank>1</rank>
<list_name>Chapter Books</list_name>
<bestsellers_date>2010-12-26</bestsellers_date>
<published_date>2011-01-09</published_date>
<weeks_on_list>11</weeks_on_list>
<rank_last_week>0</rank_last_week>
<asterisk>0</asterisk>
<dagger>0</dagger>
- <book_details>
- <book_detail>
<title>THE LOST HERO</title>
<description>A return to Camp Half-Blood and semi-divine characters old and new.</description>
<contributor>by Rick Riordan</contributor>
<author>Rick Riordan</author>
<contributor_note />
<price>18.99</price>
<age_group>Ages 10 and up</age_group>
<publisher>Disney-Hyperion</publisher>
</book_detail>
</book_details>
- <isbns>
- <isbn>
<isbn13>9781423113393</isbn13>
<isbn10>142311339X</isbn10>
</isbn>
</isbns>
- <reviews>
- <review>
<book_review_link />
<first_chapter_link />
<sunday_review_link />
<article_chapter_link>http://artsbeat.blogs.nytimes.com/2010/06/21/the-world-of-percy-jackson-lives-on-in-the-lost-hero/</article_chapter_link>
</review>
</reviews>
</book>
- <book>
<rank>2</rank>
<list_name>Chapter Books</list_name>
<bestsellers_date>2010-12-26</bestsellers_date>
<published_date>2011-01-09</published_date>
<weeks_on_list>2</weeks_on_list>
<rank_last_week>0</rank_last_week>
<asterisk>0</asterisk>
<dagger>0</dagger>
- <book_details>
- <book_detail>
<title>THE GIFT</title>
<description>A sister and brother flex their new powers; a Witch and Wizard book.</description>
<contributor>by James Patterson and Ned Rust</contributor>
<author>James Patterson and Ned Rust</author>
<contributor_note />
<price>17.99</price>
<age_group>Ages 10 and up</age_group>
<publisher>Little, Brown</publisher>
</book_detail>
</book_details>
- <isbns>
- <isbn>
<isbn13>9780316036252</isbn13>
<isbn10>0316036250</isbn10>
</isbn>
- <isbn>
<isbn13>9780316122214</isbn13>
<isbn10>0316122211</isbn10>
</isbn>
</isbns>
- <reviews>
- <review>
<book_review_link />
<first_chapter_link />
<sunday_review_link />
<article_chapter_link />
</review>
</reviews>
</book>
標籤的書之間的數據是一個記錄。現在第二個記錄包含兩個ISBN,所以這樣的數據應填充爲表格中的2條記錄(所有內容相同但不同的ISBN)
我不同意「應該填充爲2條記錄」。 ISBN-10和ISBN-13是兩個不同的東西,它們應該是數據庫中的兩個不同的列(或者對象中的兩個不同的字段)。複製該記錄是一種經典的反規範化,導致數據完整性問題在後面(如果您通過ISBN-10搜索該書,更改它,然後再通過其ISBN-13搜索它) – tdammers 2011-01-07 16:33:30
我想你讓我錯誤......在第二組數據中有2個ISBN13和ISBN10,對於ISBN 10和13有不同的列,所以那些必須填充爲具有相同標題,作者和具有不同ISBN10的兩個記錄, ISBN13,因爲每個 – 2011-01-07 16:38:10