By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,370 Members | 1,552 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,370 IT Pros & Developers. It's quick & easy.

How to solve this " problem

P: n/a
Hello,

I am accessing a value in a XML value:
news.Load(Server.MapPath("xml/ news.rss"))
newslabel.Text = CType(news.SelectSingleNode("rss version="2.0
"/channel/title").InnerText, String)

The XML file:

<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>News</title>
<description>...</description>
<item>
<title>...</title>
<description>...</description>
</item>
...
</channel>
</rss>

If I take the <rss version="2.0"> and use:
newslabel.Text =
CType(news.SelectSingleNode("channel/title").InnerText, String)

Can you tell me how to solve this? The problem is in my node path when I
have ("rss version=&quot;2.0&quot;/channel/title")

I used =&quot; instead of " to try to fix the problem but it didn't
work.

Thanks,
Miguel

Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Shapper wrote:
Hello,

I am accessing a value in a XML value:
news.Load(Server.MapPath("xml/ news.rss"))
newslabel.Text = CType(news.SelectSingleNode("rss version=&quot;2.0
&quot;/channel/title").InnerText, String)

The XML file:

<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>News</title>
<description>...</description>
<item>
<title>...</title>
<description>...</description>
</item>
...
</channel>
</rss>

If I take the <rss version="2.0"> and use:
newslabel.Text =
CType(news.SelectSingleNode("channel/title").InnerText, String)

Can you tell me how to solve this? The problem is in my node path
when I have ("rss version=&quot;2.0&quot;/channel/title")

I used =&quot; instead of " to try to fix the problem but it didn't
work.

Thanks,
Miguel


use

SelectSingleNode("/rss[@version='2.0']/channel/title")

or just

SelectSingleNode("/rss/channel/title")
Hans Kesting
Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.