|
Помогите прочитать xml файл
|
|||
---|---|---|---|
#18+
Есть xml файл следующего содержания: <?xml version="1.0" encoding="ISO-8859-1"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:cb="http://centralbanks.org/cb/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3c.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3c.org/1999/02/22-rdf-syntax-ns#rdf.xsd"> <channel rdf:about="http://www.bankofcanada.ca/fx/daily_noon.html"> <title>BoC noon rate: U.S. dollar</title> <link>http://www.bankofcanada.ca/fx/daily_noon.html</link> <description>Current day's noon foreign exchange rates from the Bank of Canada. Published at about 12:15 ET.</description> <items> <rdf:Seq> <rdf:li rdf:resource="http://www.bankofcanada.ca/rss/fx/noon/iexe0101.xml" /> </rdf:Seq> </items> <dc:language>en</dc:language> <dc:date>2009-03-23</dc:date> </channel> <item rdf:about="http://www.bankofcanada.ca/rss/fx/noon/iexe0101.xml"> <title>CA: 0.8115 USD = 1 CAD 2009-03-23 Bank of Canada noon rate</title> <link>http://www.bankofcanada.ca/fx/daily_noon.html</link> <description>1 Canadian Dollar = 0.8115 USD (USD = U.S. dollar). These are the Bank of Canada's nominal noon exchange rates, published at about 12:15 ET each business day. These are neither buying nor selling rates, and should be used for reference purposes only.</description> <dc:language>en</dc:language> <dc:date>2009-03-23</dc:date> <dc:format>text/html</dc:format> <cb:country>CA</cb:country> <cb:baseCurrency>CAD</cb:baseCurrency> <cb:targetCurrency>USD</cb:targetCurrency> <cb:value frequency="business" decimals="4">0.8115</cb:value> <cb:rateType>noon</cb:rateType> <cb:application>statistics</cb:application> </item> </rdf:RDF> По смыслу это RSS feed с курсом одной валюты к другой за определенную дату. Мне надо считать данные из этого файла, например: XmlDocument feedDocument = new XmlDocument(); feedDocument.Load(rssStream); XmlNamespaceManager manager = new XmlNamespaceManager(feedDocument.NameTable); manager.AddNamespace("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"); XmlNode titleNode =feedDocument.SelectSingleNode("/rdf:rdf/channel/title", manager); И ничего - titleNode - пусто, не видит никак. Please advice ... |
|||
:
Нравится:
Не нравится:
|
|||
24.03.2009, 23:10 |
|
Помогите прочитать xml файл
|
|||
---|---|---|---|
#18+
Код: plaintext
... |
|||
:
Нравится:
Не нравится:
|
|||
25.03.2009, 12:36 |
|
|
start [/forum/topic.php?fid=14&gotonew=1&tid=1333605]: |
0ms |
get settings: |
8ms |
get forum list: |
11ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
35ms |
get topic data: |
9ms |
get first new msg: |
7ms |
get forum data: |
2ms |
get page messages: |
42ms |
get tp. blocked users: |
1ms |
others: | 11ms |
total: | 132ms |
0 / 0 |