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, with Steve's Blueprint XML API call into Excel13

First post First post
Author
Tony Sunz
Doomheim
#1 - 2014-09-12 05:37:45 UTC  |  Edited by: Tony Sunz
Hello,
I've been going over it a few hours now and I can't seem to find the answer that I'm looking for. Here goes...

For example the XML call is for the "Crucifier" at:
https://www.fuzzwork.co.uk/blueprint/api/xml.php?typeid=2161

I am using this in order to get blueprint materials into a spreadsheet. I have used the "WEBSERVICE" fxn to get excel to see the xml, no problem. But I cannot figure out how to select the quantity for a specific type of material.

"/eveapi/activity[@activity='1']/materials/material/quantity"
This produced the result for Tritanium, but it is far too general of a query to return other materials so...

What would be the proper xpath for say Pyerite?
Maybe a close variation of...

/eveapi/activity[@activity='1']/materials/material[/name=Pyerite]/quantity

I know that I need to select the correct division of "material" based off an attribute(?) of typeid or name, then return the "quantity" but haven't been able to stumble upon the answer. Thank you for the help.


Sunz
Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#2 - 2014-09-12 10:18:05 UTC
I recommend getting the condensed version of all materials, rather than pulling each individually. That way, you can run it through a split function, and be entirely sure the data is coming back correctly.

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter

Tony Sunz
Doomheim
#3 - 2014-09-12 15:13:50 UTC  |  Edited by: Tony Sunz
Thanks for the reply Steve. I believe my question is the same still.

What is the proper XPATH to pick the correct condensed version of the materials I want? Like for Pyerite in the above example.



Thanks for the help.


Well, I figured it out. ;)

"/eveapi/activity[@activity='1']/materials/material[name='Isogen']/quantity"

Thanks anyways. Maybe someday I can figure out the SQL to excel thing, but I get lost.
Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#4 - 2014-09-12 16:06:23 UTC
Actually, I was suggesting pulling all of them. Then using a vlookup to pull the appropriate data :) More efficient.

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter

ISD Decoy
ISD Community Communications Liaisons
ISD Alliance
#5 - 2014-09-12 20:17:43 UTC
Moved to Technology Lab.

ISD Decoy

Captain

Community Communication Liaisons (CCLs)

Interstellar Services Department

Nosferatu Zodd
Behelith
#6 - 2014-09-18 23:15:22 UTC
For Pyerite it would be :
/eveapi/activity[@activity='1']/materials/material/quantity[//typeid=35]

If you want to be sure that it looks in the correct activity ID :
/eveapi/activity[@activity='1']/materials/material/quantity[/eveapi/activity[@activity='1']/materials/material/typeid=35]

If the structure of the XML doc would be like below (trunkated example) the XPATH expression would be easier.
But the structure is like this because it's also like this in the static data dump.
Steve Ronuken would need to convert the XML output for use with excel, then again it might be more troublesome for say filemaker.

[material typeID="34"]
_[name] Tritanium [/name]
_[quantity] 13333 [/quantity]
[material]
[/quote]

XPATH : /eveapi/activity[@activity='1']/materials/material[@typeID=35]/quantity

P.s.: sorry no html allowed