enclosure problem when pasring with ASP

Discussion in 'XML & RSS' started by ludwig, Jun 8, 2006.

  1. #1
    Hi,

    I am trying to get the URL of this with ASP
    <enclosure url="http://www.panarmenian.net/news/photos/18370.jpg" type="image/jpeg" />

    here is the code that I use. How can I do it.

    	<div id="scroll">
    <%
    strPANURL = "http://www.panarmenian.net/stickers/news/rss_hayam_eng.img"
    
    dim xmlDom, nodeCol, oNode, oChildNode
    set xmlDom = Server.CreateObject("MSXML2.Domdocument")
    xmlDOM.async = False
    
    call xmlDom.setProperty("ServerHTTPRequest", true)
    xmlDom.async = false
    call xmlDom.load(strPANURL)
    
    if not xmlDom.documentElement is nothing then
    	set nodeCol = xmlDom.documentElement.selectNodes("channel/item")
    			  for each oNode in nodeCol
    			    Response.Write("<div class='footer'>" & vbCrLf)
    			    set oChildNode = oNode.selectSingleNode("pubDate")
    			    if not oChildNode is nothing then
    					strPubDate = Server.HTMLEncode(oChildNode.text)
    					strPubDate = replace(strPubDate, "&amp;", "&")
    					strPubDate = replace(strPubDate, "&apos;", "&#39;")
    					strPubDate = replace(strPubDate, "&amp;apos;", "&#39;")
    					strPubDate = replace(strPubDate, "&amp;", "&")
    					strPubDate = replace(strPubDate, "?", "")
    					strPubDate = replace(strPubDate, vbCrLf, "<br>")
    			      Response.Write("<strong>" & strPubDate & "</strong><br>" & vbCrLf)
    			    end if
    			    set oChildNode = oNode.selectSingleNode("link")
    			    if not oChildNode is nothing then
    			      Response.Write("  <a href='?lang=" & strLanguage & "&newsid=" & right(oChildNode.text, 5) & "' class='footer' style='color: #CC0000;'>")
    				  strLinkAllow = "yes"
    			    end if
    			    set oChildNode = oNode.selectSingleNode("title")
    			    if not oChildNode is nothing then
    					strTitle = Server.HTMLEncode(oChildNode.text)
    					strTitle = replace(strTitle, "&amp;", "&")
    					strTitle = replace(strTitle, "&apos;", "&#39;")
    					strTitle = replace(strTitle, "&amp;apos;", "&#39;")
    					strTitle = replace(strTitle, "&amp;", "&")
    					strTitle = replace(strTitle, "?", "")
    					strTitle = replace(strTitle, vbCrLf, "<br>")
    			    	Response.Write("" & strTitle & "")
    			    end if
    				if strLinkAllow = "yes" then
    			      Response.Write("</a><br><br>" & vbCrLf)
    				end if
    			    Response.Write("</div>" & vbCrLf)
    			  next
    end if
    </div>
    Code (markup):
    please help me
     
    ludwig, Jun 8, 2006 IP