To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
VBForums  

VB Wire News
MSDN Subscribers: Download the VS 2010 Release Candidate
MSDN Subscribers: Download the VS 2010 Release Candidate
Sell Your Code and Make Money?
Creating your own Tetris game using VB.NET
Article :: Improving Software Economics, Part 4 of 7: Top 10 Principles of Iterative Software Management



Go Back   VBForums > Visual Basic > Visual Basic .NET

Reply Post New Thread
 
Thread Tools Search this Thread Display Modes
Old Jan 7th, 2005, 10:53 AM   #1
vbdotnetboy
Frenzied Member
 
vbdotnetboy's Avatar
 
Join Date: Jun 04
Location: Lewisburg, PA "Next year Raiders in the Super Bowl"
Posts: 1,310
vbdotnetboy has a spectacular aura about (100+)vbdotnetboy has a spectacular aura about (100+)
Resolved question with XML NodeList, SelectNodes, and GetElementByTagName *RESOLVED*

hey everyone, can anyone tell me if i'm right in doing the following

ok the company i work at is going to start getting XML feeds from this other company. the format of the XML isn't the best, but it's what we have to deal with the following is an example of a XML feed. All I need is the information/data that's in the Review element node. I use a search method to find the data that i need, but the question that i have is since there is data that is not in tag when i'm looping through the Review nodes within a for each loop would i have to use a nested loop within that to retrieve that data that would be considered text elements and enity elements or is there a way to pick out that data as well using the following code after the xml code. i hope this make sense.

Code:
<?xml version="1.0" encoding="utf-8" ?> 
<!DOCTYPE ISSUE PUBLIC "-//eLogic//DTD onlinetext DTD//EN" "http://dtd.eLogic.com/onlinetext/v1/onlinetext.dtd">
<ISSUE PUBLICATION="Publishers Weekly" PUBDATE="10/04/2004" VOLUME="251" ISSUE="40">
	<ARTICLE LANGUAGE="EN" SECRIGHTS="YES" PUBLICATION="Publishers Weekly" PUBDATE="10/04/2004" VOLUME="251" ISSUE="40" PAGE="31" SECTION="Audio" SUBSECTION="Reviews" AUTHNAME="Staff">
		<HEADLINE>Reviews</HEADLINE>
		<BYLINE>by Staff</BYLINE>
		<REVIEW PUBLISHER="Reed Business Information-US" AUTHNAME="Staff" RELEASEDATE="10/04/2004" LANGUAGE="EN" SECRIGHTS="YES" PUBLICATION="Publishers Weekly" PUBDATE="10/04/2004" VOLUME="251" ISSUE="40" PAGE="31" CONTENTTYPE="Review" SECTION="Audio" SUBSECTION="Reviews">
			<BIBLIO>
				<PRODUCTNAME>AN UNFINISHED LIFE</PRODUCTNAME>
				<PRODUCTCREATOR>Mark Spragg</PRODUCTCREATOR>
				, read by Tony Amendola and Judith Marx. 
				<PRODUCTPUBLISHER>HighBridge Audio</PRODUCTPUBLISHER>
				, unabridged, six CDs, 7 hrs., $29.95 ISBN 
				<ISBN>1-56511-900-2</ISBN>
			</BIBLIO>
			<P>A sober reading by Amendola and Marx fits the slow pacing of Spragg's newest offering (following <EMPHASIS TYPE="ITALIC">The Fruit of Stone</EMPHASIS>), which uses spare, beautiful language to tell a tale of hardship, resentment and reconciliation in smalltown Wyoming. Both veteran narrators give strong performances, though Amendola does a better job than Marx in personifying the book's more idiosyncratic characters—such as the crippled cowboy, Mitch, or the spunky, nine-year-old Griff Gilkyson. A few aspects of the production seem out of sync, however. For one, the ominous music that introduces and concludes each disc is too heavy for the subject matter. It conveys a sense of impeding doom that would be more appropriate in a thriller or even a tale of imminent tragedy, rather than this ultimately hopeful story of tried but tender human relationships. The decision to use two readers also seems unnecessary, as the unpredictable shifts between narrators at chapter breaks shake the listener out of the story. Overall, the recording would have benefited from a simpler approach, but it still offers a stirring look at the importance of individual conflicts and emotions. <EMPHASIS TYPE="ITALIC">Simultaneous release with the Knopf hardcover (Forecasts, Aug. 9). (Sept.)</EMPHASIS></P>
		</REVIEW>
		<REVIEW PUBLISHER="Reed Business Information-US" AUTHNAME="Staff" RELEASEDATE="10/04/2004" LANGUAGE="EN" SECRIGHTS="YES" PUBLICATION="Publishers Weekly" PUBDATE="10/04/2004" VOLUME="251" ISSUE="40" PAGE="31" CONTENTTYPE="Review" SECTION="Audio" SUBSECTION="Reviews">
			<BIBLIO>
				<PRODUCTNAME>LOVE IS MURDER</PRODUCTNAME>
				<PRODUCTCREATOR>Linda Palmer</PRODUCTCREATOR>
				, read by Celeste Lawson. 
				<PRODUCTPUBLISHER>Blackstone Audiobooks</PRODUCTPUBLISHER>
				, unabridged, six cassettes, 7.5 hrs., $29.95 ISBN 
				<ISBN>0-7861-2736-8</ISBN>
			</BIBLIO>
			<BIBLIO>
				<PRODUCTNAME>JUST ANOTHER EXAMPLE</PRODUCTNAME>
				<PRODUCTCREATOR>Linda Palmer</PRODUCTCREATOR>
				, read by Celeste Lawson. 
				<PRODUCTPUBLISHER>Blackstone Audiobooks</PRODUCTPUBLISHER>
				, unabridged, six cassettes, 7.5 hrs., $29.95 ISBN 
				<ISBN>0-7861-2736-X</ISBN>
			</BIBLIO>
			<P>Combining romance, humor and suspense, this offbeat debut mystery from Palmer, a screenwriting teacher and former wildlife photographer, offers a behind-the-scenes look at the soap opera industry. Narrator Lawson slips easily into the character of vulnerable Morgan Tyler, a beautiful young widow and Emmy Award-winning soap opera writer. Morgan's life begins to resemble the outlandish scripts she writes when the head of her network's daytime programming is murdered and she, as his unwitting beneficiary, becomes the prime suspect. Fortunately for Morgan, Detective Matt Phoenix seems to be interested in more than just her alibi. The characters' exchanges are fast-paced and often tinged with sarcasm, but Lawson shines in this arena, switching seamlessly among various intonations and accents, even such disparate ones as English and Southern. With its smart dialogue and quirky characters—including Morgan's "50-ish and desperate" competitor Helen and Matt's sweet-as-pie but delusional Aunt Penny—this tale is perfect for audio adaptation, and Lawson does a fine job of bringing it to life. <EMPHASIS TYPE="ITALIC">Based on the Berkley paperback. (Aug.)</EMPHASIS></P>
		</REVIEW>		
		<P>Audio reviews reflect <EMPHASIS TYPE="ITALIC">PW</EMPHASIS>'s assessment of the audio adaptation of a book and should be quoted only in reference to the audio version.</P>
		<SUBHEAD>Fiction</SUBHEAD>
	</ARTICLE>
</ISSUE>
VB Code:
  1. Sub PracticeRun(xdoc As Xml.XmlDocument)
  2.     Dim xNode As Xml.XmlNodeList = xdoc.SelectNodes("//REVIEW")
  3.     For Each node As Xml.XmlNode In xNode
  4.         Dim xEl As Xml.XmlElement = DirectCast(node, Xml.XmlElement)
  5.         For i As Integer = 0 To (xEl.GetElementsByTagName("BIBLIO").Count - 1
  6.             Console.WriteLine(xEl.GetElementsByTagName("PRODUCTNAME")(0).InnerText)
  7.             'I may need to get text or enity information after product name here....this is where i'm not sure.
  8.             Console.WriteLine(xEl.GetElementsByTagName("ISBN")(0).InnerText)
  9.             'Again may need to get text or enity information here.
  10.             Console.WriteLine(xEl.GetElementsByTageName("P")(0).InnerText)
  11.         Next
  12.     Next
  13. End Sub



thanx in advance
__________________

Derek - Using VS 2008 99% of the time and VS 2003 1% of the time

Please Help Us To Save Ana

● Helpful Links: DNR TV | Awesome site for tips | Using ADO.NET to work with Excel | Xml Namespace 2.0 Framework Changes|Ultra High Security Password Generator | Mendhak's ADO.NET Tutorial
● Code Bank: Random Password Generator | Generic DbProviderFactory Access
● Site Work: Bottle Run Xtreme | Spaids Racing.com

Company I work for - CSSI

WHEN POSTING PLEASE INDICATE VERSION

Please use vbcode tags or code tags when posting code
[highlight=vb]ALL your code goes here[/highlight] or [code]ALL your code goes here[/code]

If my post helped you in anyway... please be kind and give me some ratings

Last edited by vbdotnetboy; Jan 7th, 2005 at 11:16 AM. Reason: Resolved
vbdotnetboy is offline   Reply With Quote
Old Jan 7th, 2005, 11:15 AM   #2
vbdotnetboy
Frenzied Member
 
vbdotnetboy's Avatar
 
Join Date: Jun 04
Location: Lewisburg, PA "Next year Raiders in the Super Bowl"
Posts: 1,310
vbdotnetboy has a spectacular aura about (100+)vbdotnetboy has a spectacular aura about (100+)
Re: question with XML NodeList, SelectNodes, and GetElementByTagName

nevermind i figured it out finally... thanx anyway
__________________

Derek - Using VS 2008 99% of the time and VS 2003 1% of the time

Please Help Us To Save Ana

● Helpful Links: DNR TV | Awesome site for tips | Using ADO.NET to work with Excel | Xml Namespace 2.0 Framework Changes|Ultra High Security Password Generator | Mendhak's ADO.NET Tutorial
● Code Bank: Random Password Generator | Generic DbProviderFactory Access
● Site Work: Bottle Run Xtreme | Spaids Racing.com

Company I work for - CSSI

WHEN POSTING PLEASE INDICATE VERSION

Please use vbcode tags or code tags when posting code
[highlight=vb]ALL your code goes here[/highlight] or [code]ALL your code goes here[/code]

If my post helped you in anyway... please be kind and give me some ratings
vbdotnetboy is offline   Reply With Quote
Reply

Go Back   VBForums > Visual Basic > Visual Basic .NET


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 01:17 PM.




To view more projects, click here

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.