.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 31st, 2012, 02:31 AM
amstel_za amstel_za is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 378 amstel_za User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 Days 14 h 38 sec
Reputation Power: 10
C# : Problem reading RDF XML tags

Apologies!

Wrong issue!

I'm trying to read the

<item><title>
<item><link>
<item><Description>

from this XML (portion provided)

Code:
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:prism="http://purl.org/rss/1.0/modules/prism/" xmlns:admin="http://webns.net/mvcb/">
.
.
.
  <item rdf:about="http://geology.gsapubs.org/cgi/content/abstract/40/2/99?rss=1">
    <title><![CDATA[Tectonic subsidence of the Lomonosov Ridge]]></title>
    <link>http://geology.gsapubs.org/cgi/content/abstract/40/2/99?rss=1</link>
    <description>
      <![CDATA[
<p>The Cenozoic sedimentary record revealed by the uplift followed by rapid subsidence to the deep-water environment observed on the Lomonosov Ridge today.</p>
]]>
    </description>
  </item>


but cannot using

Code:
XmlDocument xDoc = new XmlDocument();
                HttpWebRequest rssFeed = (HttpWebRequest)WebRequest.Create(incomingURL);
                xDoc.Load(rssFeed.GetResponse().GetResponseStream());
                        
                XmlNodeList _items = xDoc.GetElementsByTagName("item");
foreach...
{
string text = xNode.SelectSingleNode("title").InnerText;
}


--I've tried adding a NamespaceManager but still no joy...since it's not prefixed with rdf: do I need a namespace manager ?

I have all the <item> nodes in a nodelist so that works - so I cannot grasp why I cannot take the title, link, description from them ?

Ben

Last edited by amstel_za : January 31st, 2012 at 05:12 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > C# : Problem reading XML tags

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap