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.
 

Struggling with Xpath

Author
Gilbaron
The Scope
Gallente Federation
#1 - 2017-03-16 13:08:44 UTC
=IMPORTXML(C4;"/eveapi/result/rowset/row/@typeID")

This gives me the TypeIDs of all my orders

How can i only request the TypeIDs of all orders that have an orderState="0" (aka Sell orders)
Blacksmoke16
Resilience.
#2 - 2017-03-16 15:10:41 UTC
Try this. I don't have something to test it atm tho.

IMPORTXML(C4;"//row[@orderState=0]/@typeID")
Gilbaron
The Scope
Gallente Federation
#3 - 2017-03-16 20:29:48 UTC
seems to be working. i don't really understand why though :D

thanks!
Tonto Auri
Vhero' Multipurpose Corp
#4 - 2017-03-16 22:19:08 UTC
"//row" is "select all row tags no matter where they are located".
=IMPORTXML(C4;"/eveapi/result/rowset/row[@orderState=0]/@typeID")
would've had the same effect.

Two most common elements in the universe are hydrogen and stupidity. -- Harlan Ellison

Blacksmoke16
Resilience.
#5 - 2017-03-17 01:10:16 UTC
Pretty much what he said.

=IMPORTXML(C4;"//row[@orderState=0]/@typeID")

C4 Obs the url of the api

//row select all rows no matter where there are

[@orderState=0] selects only the rows with the orderState attribute equal to 0

/@typeID returns the typeID attribute for the rows that have the orderState = 0
Gilbaron
The Scope
Gallente Federation
#6 - 2017-03-17 15:08:55 UTC
my understanding was that / would take my request to a child of a node, whereas typeID and orderState were actually both just attributes in the same

apparently i was wrong

thanks for the clarifications!
Tonto Auri
Vhero' Multipurpose Corp
#7 - 2017-03-17 17:06:59 UTC
"/" would take your request to the child of a node, if you select the child node. Selecting an attribute will search within attributes of a current node.

Two most common elements in the universe are hydrogen and stupidity. -- Harlan Ellison