Sign in to follow this  
Followers 0
luckyluke

_XMLGetAllAttrib dont run with this xml file?

3 posts in this topic

#1 ·  Posted (edited)

i'm trying to get attrib value from 'link' node but why i cant

#include <_XMLDomWrapper.au3>
#include <Array.au3>



_SetDebug (True);show debug messages via console write
$sXmlFile = FileOpenDialog("", @ProgramFilesDir & "\autoit\scrpits", "XML (*.xml)", 1)
;ConsoleWrite($sXmlFile&@lf)
If @error Then
    MsgBox(4096, "File Open", "No file chosen")
    Exit
Else
    $oOXml = ""
    $oOXml = _XMLFileOpen ($sXmlFile)
EndIf

Dim $aAttrName[1], $aAttrValue[1], $node
    $retval = _XMLGetAllAttrib('//feed[@xmlns="http://www.w3.org/2005/Atom"]/entry/link[rel="alternate"]',$aAttrName,$aAttrValue); get all attribs
    if IsArray($aAttrName) Then
        _ArrayDisplay($aAttrName,"Attrib Names")
        _ArrayDisplay($aAttrValue,"Attrib Values")
    Else
        msgbox(0,"Error","Test "&$test&" not found.")
        Exit
    EndIf

Here is XML file:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?>

<feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:gd="http://schemas.google.com/g/2005" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DUAFQXk8fip7ImA9WxBaFUU.&quot;"><id>tag:blogger.com,1999:blog-4157678335535108976</id><updated>2010-03-26T14:15:10.776+07:00</updated><title>blogget</title><subtitle type="html" /><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://boyprodx.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds//posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>boyproDX</name><uri>http://www.blogger.com/profile/</uri><email>noreply@blogger.com</email></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>369</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com" /><feedburner:info uri="boyprodx" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" />
<feedburner:emailServiceId>gmail/feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname>

<entry gd:etag="W/&quot;DkYERX05fCp7ImA9WxNSFE4.&quot;">
<id>tag:blogger.com,1999:blog.post-6</id>
<published>2009-08-28T11:33:00.001+07:00</published><updated>2009-08-28T11:35:04.324+07:00</updated>
<app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-28T11:35:04.324+07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="soft" />
<title>Microsoft Office</title>

<link rel="replies" type="text/html" href="http://blogspot.com/2009/08/#comment-form" title="4 Comments" />
<link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/posts/default/211931041626984246?v=2" />
<link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/posts/default/211931041626984246?v=2" />
<link rel="alternate" type="text/html" href="http://feedproxy.google.com" title="sowf" />
<author><name>boyproDX</name><uri>http://www.blogger.com/profile/</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="08" /></author>
<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://blogspot.com/_K1kfqOH2Mmc/SpdcbeAdUZI/AAAAAAAABWI/oVDZyUNLMdM/s72-c/setting.jpeg" height="72" width="72" /><thr:total>4</thr:total>

<feedburner:origLink>http://blogspot.com/2009/08/duyet.html</feedburner:origLink></entry>
Edited by luckyluke

Share this post


Link to post
Share on other sites



its not working:

Error retrieving attributes for: //feed[@xmlns="http://www.w3.org/2005/Atom"]/entry/link[@rel="alternate"]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0