Question : How to get the href attribute from an ATOM feed being parsed

OK I think this is a fairly easy question.  I have a scraper written that takes a given atom url, parses it into a variable, then sets individual variables for each node.  All is well except for the link node because it is formed differently.  Can somone please correct my link variable so it will contain the href attribute?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
<%
function getNews(strurl)

      set ObjSXH = createobject("Msxml2.ServerXMLHTTP.3.0")
      set objXML = createobject("Msxml2.DOMDocument")
                  
      url = strurl
      
      ObjSXH.open "GET", url, False
      'Send the request
      ObjSXH.send ""

      'If the request succeeded
      if ObjSXH.status = 200 then
            'returned XML as a DOMDocument
            set ObjXML = ObjSXH.responseXML
            
            'retrieve products from xml document
            on error resume next
          
          
            set entryNodeList = objXML.getElementsByTagName("entry")
            listLength = entryNodeList.length
                  
            for j = 0 to listLength - 1
               
                  If listLength > 0 Then
                      entryCount = entryCount + 1
				  End If
                  
                  set entryNode = entryNodeList.Item(j)
                  
                  'reinitialize variables
              
              title = ""
              link = ""
              id = ""
              published = ""
              updated = ""
              summary = ""
           
                for each entryAttribute in entryNode.childNodes
                      
                        nodeName = UCASE(entryAttribute.nodeName)      
                              
                  set entryNode = entryNodeList.Item(j)
                  
                  If nodeName = "TITLE" Then
		  title = Replace(entryAttribute.Text, "'", "''")
                  ElseIf nodeName = "LINK" Then
                    link = Replace(entryAttribute.Text, "'", "''")
	         ElseIf nodeName = "ID" Then
                    id = Replace(entryAttribute.Text, "'", "''")
                  ElseIf nodeName = "PUBLISHED" Then
                    published = Replace(entryAttribute.Text, "'", "''")
                  ElseIf nodeName = "UPDATED" Then
                    updated = Replace(entryAttribute.Text, "'", "''")
                  ElseIf nodeName = "SUMMARY" Then
                    summary = Replace(entryAttribute.Text, "'", "''")
                  End If
                Next
                   if entryName = "" then entryName = left(description,400)
       
                 '-- insert into database
                                            
          Next

      end if

      getNews = title&"|"&link&"|"&id&"|"&published&"|"&updated&"|"&summary
      

end function

Response.write getNews("http://blog.mlive.com/saginawnews_impact/atom.xml")
%>

Answer : How to get the href attribute from an ATOM feed being parsed

Hi North_Side,

I went deeply in the problem and composed a macro that converts frames to textboxes.
It is not 100% universal but gives acceptable results on files you provided.
You may place this macro in Normal.dot and it will be always available by pressing Alt+F8 - 2click on macro name.
The process is rather time-consuming so I added progress report to status bar.
Please try. I also inserted macro in the document you provided.

Alex
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
'---------------------------------------------------------------------------------------
' Procedure : Frames2TextBoxes
' Author    : Alexey Egorov, [email protected]
' Date      : 11-Jul-2010
' Purpose   : Replaces all frames in active document with textboxes keeping position.
' Topic     : http://www.experts-exchange.com/Microsoft/Applications/Q_26319089.html
'---------------------------------------------------------------------------------------
Sub Frames2TextBoxes()
Dim aF() As Word.Frame, f As Word.Frame, t As Word.Shape, i As Long, n As Long
Dim stbar As Boolean
On Error GoTo err_
Application.ScreenUpdating = False
stbar = Application.DisplayStatusBar
n = ActiveDocument.Frames.Count
ReDim aF(n)
For i = 1 To n
    Set aF(i) = ActiveDocument.Frames(i)
Next

For i = 1 To n
    Application.StatusBar = Format(i, """Converting ""####") & Format(n, """ of ""####")
    Set f = aF(i)
    f.Range.Select
    Selection.CreateTextbox
    Set t = Selection.ShapeRange(1)
    t.RelativeHorizontalPosition = wdRelativeHorizontalPositionPage
    t.RelativeVerticalPosition = wdRelativeVerticalPositionPage
    t.Width = f.Width
    t.Height = f.Height
    t.Left = f.HorizontalPosition
    t.Top = f.VerticalPosition
    
    With t.TextFrame
        .MarginBottom = 0
        .MarginLeft = 0
        .MarginRight = 0
        .MarginTop = 0
    End With
    t.Line.Visible = msoFalse
Next
exit_here:
Application.ScreenUpdating = True
Application.DisplayStatusBar = stbar

Exit Sub

err_:
MsgBox Err.Description, vbCritical
Resume exit_here
End Sub
Random Solutions  
 
programming4us programming4us