luckyluke Posted March 26, 2010 Posted March 26, 2010 (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/"DUAFQXk8fip7ImA9WxBaFUU.""><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&max-results=25&redirect=false&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/"DkYERX05fCp7ImA9WxNSFE4.""> <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 March 26, 2010 by luckyluke
GaRydelaMer Posted March 26, 2010 Posted March 26, 2010 Hi,$retval = _XMLGetAllAttrib('//feed[@xmlns="http://www.w3.org/2005/Atom"]/entry/link[rel="alternate"]',$aAttrName,$aAttrValue);Perhaps with$retval = _XMLGetAllAttrib('//feed[@xmlns="http://www.w3.org/2005/Atom"]/entry/link[@rel="alternate"]',$aAttrName,$aAttrValue);
luckyluke Posted March 27, 2010 Author Posted March 27, 2010 its not working: Error retrieving attributes for: //feed[@xmlns="http://www.w3.org/2005/Atom"]/entry/link[@rel="alternate"]
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now