0

I have been parsing xml content using the xmlreader and cannot use the xml document but so far it works getting all elementcontent except for the attribute contents. I need to parse the link below found in the following entry;

<title>XXXX UUUUUU posted a</title>
<category term="NotePosted" label="Note Posted"/>
 <link rel="alternate" type="html"  href="http://www.dfsddsfdsf.com/profile.php?id=sdfdfsfdsdfddfsfd&amp;v=wall&amp;story_dbid=dssdfasdfdasfdsafafafa"/>
<source>......... <source>

I need the href tag in the link attribute but it keeps coming back null.

                 While ureader.Read
                    If ureader.HasAttributes Then
                        fId = ureader.GetAttribute("href")
                        If fId.Contains("?v=wall&amp") Then
                            fIdList.Add(fId)
                            Exit While
                        End If
                        If String.IsNullOrEmpty(fId) Then
                            fId = "NOTHING"
                        End If
                    End If
                End While

2 Answers 2

1
ureader.GetAttribute("link")

should be

ureader.GetAttribute("href")
Sign up to request clarification or add additional context in comments.

Comments

0

figured it out finally

just added this

 If ureader.MoveToAttribute("href") Then
                        fId = ureader.ReadInnerXml
 End If

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.