Jump to content

Recommended Posts

Posted

Hey guys, I've been trying to get this to work for a while now

This is my script and the xml, please let me know what I'm doing wrong here. I think its the format of the xml that gives me an error of -1

Thanks in advance

#include "_XMLDomWrapper.au3"
$xml = _XMLFileOpen( @ScriptDir&"\savage garden.xml" )
$node = _XMLGetValue("//playlist/trackList/track/location[1]")
ConsoleWrite($node)

<playlist version="1" start="0" end="9" total="142" prev="None" next="10">
<title><title/>
<trackList>
<track>
<location>
http://espanol.geocities.com/neto3033/mp3/Savage_Garden_-_Break_me_shake_me.mp3
</location>
<title>Break Me Shake Me</title>
<creator>Savage Garden</creator>
<album>Savage Garden</album>
<genre>Pop</genre>
<composer/>
ETC...
Check out ConsultingJoe.com
Posted

Hey guys, I've been trying to get this to work for a while now

This is my script and the xml, please let me know what I'm doing wrong here. I think its the format of the xml that gives me an error of -1

Thanks in advance

#include "_XMLDomWrapper.au3"
$xml = _XMLFileOpen( @ScriptDir&"\savage garden.xml" )
$node = _XMLGetValue("//playlist/trackList/track/location[1]")
ConsoleWrite($node)

<playlist version="1" start="0" end="9" total="142" prev="None" next="10">
<title><title/>
<trackList>
<track>
<location>
http://espanol.geocities.com/neto3033/mp3/Savage_Garden_-_Break_me_shake_me.mp3
</location>
<title>Break Me Shake Me</title>
<creator>Savage Garden</creator>
<album>Savage Garden</album>
<genre>Pop</genre>
<composer/>
ETC...
Maybe <title><title/> should be <title></title>? Or for empty node you may use <title/> alone instead.
Posted

Well take a look at the API call from this site.

http://www.seeqpod.com/api/v0.2/c8fb8383e0...madly%20deeply/

Guess you want get location of first track found. For this I think more correct will be xpath "//playlist/trackList/track[0]/location".

But this doesn't work with XMLWrapper either, though this code work fine:

$oXml = ObjCreate("Msxml2.DOMDocument")
$oXml.Load(@ScriptDir&"\savage garden.xml")

$oNodeList = $oXml.documentElement.selectNodes("//playlist/trackList/track[0]/location")
For $oNode In $oNodeList
    ConsoleWrite($oNode.Text & @CRLF)
Next

Probably a bug in the XMLWrapper?

Posted

Hi, There are two things needing amending.

1.- Like Lazycat said should be </title> in the xml file. About the example at http://www.seeqpod.com/api/v0.2 should be noted that it is <title/> like short notation of <title></title>. Also it can be just only <title/>, that is deleting <title> in xml file.

2.- At code example, should be ConsoleWrite($node[1]) instead of ConsoleWrite($node).

Regards,

Eduardo.

  • 10 months later...

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...