These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

Xpath help.

First post
Author
SomethingIs InMyButt
Levy Guards
Pandemic Horde
#1 - 2014-02-23 23:43:17 UTC  |  Edited by: SomethingIs InMyButt
hello, I need to know how to filter items in Xpath.
so far, under the API
I have this query, where I want to filter out anything that isn't a player donation:

//row[@reftypeid='10']/@ownername1
(this is for googledocs, where there are special exceptions)
Edit: it gives me an error that nothing was returned.
If i could get some help to do this the correct way, I'd give them an internet cookie

thanks in advance,
-butt
ISD LackOfFaith
ISD Community Communications Liaisons
ISD Alliance
#2 - 2014-02-24 16:02:01 UTC
A few issues:

1. Simply copy-pasting the sample XML found at the link you gave results in malformed XML. Some of the attributes do not have spaces between the value of the last attribute and the next one. I fixed it and uploaded a good copy here: http://pastebin.com/Lim7gQ36

2. XPath appears to be case-sensitive with regards to attribute names. So, your query needs to be "//row[@refTypeID='10']/@ownerName1" instead.

3. If you were using the sample XML from the page you linked... that does not actually contain any rows with refTypeID=10. You might want to use a better dataset to test this particular XPath.

Hope this helped!

ISD LackOfFaith

Captain

Community Communication Liaisons (CCLs)

Interstellar Services Department

I do not respond to Eve Mail or anything other than the forums.

Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#3 - 2014-02-25 21:20:07 UTC
If you're using it in googledocs, they lowercase all the attribute and element names.


Took some fiddling to find that out (unless they've change it again)

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter

SomethingIs InMyButt
Levy Guards
Pandemic Horde
#4 - 2014-02-25 21:20:58 UTC
ISD LackOfFaith wrote:
A few issues:

1. Simply copy-pasting the sample XML found at the link you gave results in malformed XML. Some of the attributes do not have spaces between the value of the last attribute and the next one. I fixed it and uploaded a good copy here: http://pastebin.com/Lim7gQ36

2. XPath appears to be case-sensitive with regards to attribute names. So, your query needs to be "//row[@refTypeID='10']/@ownerName1" instead.

3. If you were using the sample XML from the page you linked... that does not actually contain any rows with refTypeID=10. You might want to use a better dataset to test this particular XPath.

Hope this helped!



My bad, i need to be way more specific.

A) im using my allmighty (omnipotent) api key that only i can access

B) for some reason, in google docs, you use lowercase when you use the @ symbol to call a return, did not know if it was different with brackets

C)i'm using p
Import xml in google docs,


Thanks for the response,
-butt