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:
Sub PracticeRun(xdoc As Xml.XmlDocument)
Dim xNode As Xml.XmlNodeList = xdoc.SelectNodes("//REVIEW")
For Each node As Xml.XmlNode In xNode
Dim xEl As Xml.XmlElement = DirectCast(node, Xml.XmlElement)
For i As Integer = 0 To (xEl.GetElementsByTagName("BIBLIO").Count - 1
Console.WriteLine(xEl.GetElementsByTagName("PRODUCTNAME")(0).InnerText)
'I may need to get text or enity information after product name here....this is where i'm not sure.
Console.WriteLine(xEl.GetElementsByTagName("ISBN")(0).InnerText)
'Again may need to get text or enity information here.
Console.WriteLine(xEl.GetElementsByTageName("P")(0).InnerText)
Next
Next
End Sub
:confused:
thanx in advance :wave:
Re: question with XML NodeList, SelectNodes, and GetElementByTagName
nevermind i figured it out finally... thanx anyway :wave: