Hallo und Guten Abend an Alle,
ich möchte eine Datei (XML) parsen. Dazu habe ich mir die xmldom besorgt.
Wenn ich jetzt die Anzahl der Nodes ausgeben lassen will, erhalte ich folgende Fehlermeldung:
Spoiler anzeigen
>"C:\Programme\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "G:\Eigene Dateien 14.7.2011\meine.au3" /autoit3dir "C:\Programme\AutoIt3" /UserParams
+>20:37:40 Starting AutoIt3Wrapper v.2.0.1.24 Environment(Language:0407 Keyboard:00000407 OS:WIN_XP/Service Pack 3 CPU:X64 OS:X86)
>Running AU3Check (1.54.19.0) from:C:\Programme\AutoIt3
+>20:37:40 AU3Check ended.rc:0
>Running 3.3.6.1):C:\Programme\AutoIt3\autoit3.exe "G:\Eigene Dateien 14.7.2011\meine.au3"
@@ Debug(25) : $rc = 1
>Error code: 0
Error retrieving node count for: /feed/entry
No nodes of specified type found.
@@ Debug(2 : $rc = -1
>Error code: 1
+>20:37:41 AutoIT3.exe ended.rc:0
>Exit code: 0 Time: 2.232
Ich bin mir aber hundertprozentig sicher, daß es hunderte von Einträgen für "entry" gibt.
Auszug aus der XML:
Spoiler anzeigen
<?xml version='1.0' encoding='UTF-8'?>
<feed xmlns='http://www.w3.org/2005/Atom' xmlns:app='http://www.w3.org/2007/app' xmlns:media='http://search.yahoo.com/mrss/' xmlns:openSearch='http://a9.com/-/spec/opensearch/1.1/' xmlns:gd='http://schemas.google.com/g/2005' xmlns:yt='http://gdata.youtube.com/schemas/2007' gd:etag='W/"Dk8MQ389fCp7ImA9WhdSFkU."'>
<id>tag:youtube.com,2008:user:7600celsius:uploads</id>
<updated>2011-07-26T12:54:42.164Z</updated>
<category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#video'/>
<title>Uploads by 7600celsius</title>
<logo>http://www.youtube.com/img/pic_youtubelogo_123x63.gif</logo>
<link rel='related' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/users/7600celsius'/>
<link rel='alternate' type='text/html' href='http://www.youtube.com/profile_videos?user=7600celsius'/>
<link rel='hub' href='http://pubsubhubbub.appspot.com'/>
<link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/users/7600celsius/uploads'/>
<link rel='http://schemas.google.com/g/2005#batch' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/users/7600celsius/uploads/batch'/>
<link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/users/7600celsius/uploads?start-index=51&max-results=5'/>
<link rel='service' type='application/atomsvc+xml' href='http://gdata.youtube.com/feeds/api/users/7600celsius/uploads?alt=atom-service'/>
<link rel='previous' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/users/7600celsius/uploads?start-index=46&max-results=5'/>
<link rel='next' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/users/7600celsius/uploads?start-index=56&max-results=5'/>
<author>
<name>7600celsius</name>
<uri>http://gdata.youtube.com/feeds/api/users/7600celsius</uri>
</author>
<generator version='2.0' uri='http://gdata.youtube.com/'>YouTube data API</generator>
<openSearch:totalResults>1254</openSearch:totalResults>
<openSearch:startIndex>51</openSearch:startIndex>
<openSearch:itemsPerPage>5</openSearch:itemsPerPage>
<entry gd:etag='W/"DUMBSH47eCp7ImA9WhdTGUs."'>
<id>tag:youtube.com,2008:video:FxIh70nkZmE</id>
<published>2011-05-16T04:18:07.000Z</published>
<updated>2011-07-18T05:37:39.000Z</updated>
<app:control>
<app:draft>yes</app:draft>
<yt:state name='restricted' reasonCode='requesterRegion'>This video is not available in your region.</yt:state>
</app:control>
<category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#video'/>
<title>Alan Parsons - Prime Time ( live )</title>
<link rel='alternate' type='text/html' href='http://www.youtube.com/watch?v=FxIh70nkZmE&feature=youtube_gdata'/>
<link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/users/7600celsius/uploads/FxIh70nkZmE'/>
<author>
<name>7600celsius</name>
<uri>http://gdata.youtube.com/feeds/api/users/7600celsius</uri>
</author>
<media:group>
<media:category label='Musik' scheme='http://gdata.youtube.com/schemas/2007/categories.cat'>Music</media:category>
<media:credit role='uploader' scheme='urn:youtube'>7600celsius</media:credit>
<media:title type='plain'>Alan Parsons - Prime Time ( live )</media:title>
<yt:videoid>FxIh70nkZmE</yt:videoid>
</media:group>
</entry>
<entry gd:etag='W/"DEYMR347eCp7ImA9WhdTGUs."'>
<id>tag:youtube.com,2008:video:m1pbM7_gdUg</id>
<published>2011-05-14T04:31:05.000Z</published>
<updated>2011-07-18T05:16:26.000Z</updated>
<app:control>
<app:draft>yes</app:draft>
<yt:state name='restricted' reasonCode='requesterRegion'>This video is not available in your region.</yt:state>
</app:control>
<category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#video'/>
<title>Alan Parsons - Prime time ( live )</title>
<link rel='alternate' type='text/html' href='http://www.youtube.com/watch?v=m1pbM7_gdUg&feature=youtube_gdata'/>
<link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/users/7600celsius/uploads/m1pbM7_gdUg'/>
<author>
<name>7600celsius</name>
<uri>http://gdata.youtube.com/feeds/api/users/7600celsius</uri>
</author>
<media:group>
<media:category label='Musik' scheme='http://gdata.youtube.com/schemas/2007/categories.cat'>Music</media:category>
<media:credit role='uploader' scheme='urn:youtube'>7600celsius</media:credit>
<media:title type='plain'>Alan Parsons - Prime time ( live )</media:title>
<yt:videoid>m1pbM7_gdUg</yt:videoid>
</media:group>
</entry>
<entry gd:etag='W/"DEYMRH47eCp7ImA9WhdTGUs."'>
<id>tag:youtube.com,2008:video:l5K7st4YfTA</id>
<published>2011-05-14T04:29:42.000Z</published>
<updated>2011-07-18T05:16:25.000Z</updated>
<app:control>
<app:draft>yes</app:draft>
<yt:state name='restricted' reasonCode='requesterRegion'>This video is not available in your region.</yt:state>
</app:control>
<category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#video'/>
<title>Alan Parsons - Old and wise ( Live )</title>
<link rel='alternate' type='text/html' href='http://www.youtube.com/watch?v=l5K7st4YfTA&feature=youtube_gdata'/>
<link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/users/7600celsius/uploads/l5K7st4YfTA'/>
<author>
<name>7600celsius</name>
<uri>http://gdata.youtube.com/feeds/api/users/7600celsius</uri>
</author>
<media:group>
<media:category label='Musik' scheme='http://gdata.youtube.com/schemas/2007/categories.cat'>Music</media:category>
<media:credit role='uploader' scheme='urn:youtube'>7600celsius</media:credit>
<media:title type='plain'>Alan Parsons - Old and wise ( Live )</media:title>
<yt:videoid>l5K7st4YfTA</yt:videoid>
</media:group>
</entry>
Hier mein Script:
[autoit]
Global $debugging = True
$rc = _XMLFileOpen(@ScriptDir & "\test.xml")
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $rc = ' & $rc & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
if $rc = 1 Then
$iEntryCnt = _XMLGetNodeCount("/feed/entry", "", $NODE_ELEMENT)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $rc = ' & $iEntryCnt & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
EndIf
Vielen Dank schon mal für Eure Hilfe.

