Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8700145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:07:10+00:00 2026-06-13T02:07:10+00:00

I am working with a Eve Online request that returns XML. I am using

  • 0

I am working with a Eve Online request that returns XML. I am using HTTParty for the request, and I am trying to use Nokogiri to obtain attribute values for a specific element.

Here’s an example of the response:

 <eveapi version="2"><currentTime>2012-10-19 22:41:56</currentTime><result><rowset  name="transactions" key="refID"  columns="date,refID,refTypeID,ownerName1,ownerID1,ownerName2,ownerID2,argName1,argID1,amount,balance,reason,taxReceiverID,taxAmount"><row date="2012-10-18 23:41:50" refID="232323" refTypeID="9" ownerName1="University of Caille" ownerID1="32232" ownerName2="name" ownerID2="34343" argName1="" argID1="0" amount="5000.00" balance="5000.00" reason="Starter fund" taxReceiverID="" taxAmount=""/></rowset></result><cachedUntil>2012-10-19 23:03:40</cachedUntil></eveapi>

I only need to access attributes for the element “row” and there can be many rows returned.

I read about XPath and, from what I understand, if I do the following it should return all rows: doc.xpath('row') however, it does not return anything.

Here’s what I have so far:

options = {:keyID => 111111, :vCode => 'fddfdfdfdf'}
response = HTTParty.post('https://api.eveonline.com/char/WalletJournal.xml.aspx', :body => options)
doc = Nokogiri::XML(response.body)
doc.xpath('row').each do |r|

end

The loop is never executed.

What am I doing wrong? I need to return all row elements and gain access to each of the row’s attributes.

Here’s the code I had before, which worked until I tried a different character and received a “cannot convert integer to string error”:

options = {:keyID => 434343, :vCode => 'fdfdfdfdf'}
response = HTTParty.post('https://api.eveonline.com/char/WalletJournal.xml.aspx', :body => options)
data = response.parsed_response
data['eveapi']['result']['rowset']['row'].each do |t|
  if t['ownerName2'].eql?('name') && !t['reason'].eql?('Starter fund')
    uniqueKey = t['ownerID1'].to_s + t['date']
    if !Payment.exists?(:unique_payment_key => uniqueKey)
      p = Payment.new
      p.owner_id = t['ownerID1']
      p.owner_name = t['ownerName1']
      p.unique_payment_key = uniqueKey
      p.amount = t['amount']
      p.reason = t['reason']
      p.save
    end
  end
end

Sorry, the error is error: can't convert String into Integer online line 42 which is

if t['ownerName2'].eql?('name') && !t['reason'].eql?('Starter fund')
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T02:07:10+00:00Added an answer on June 13, 2026 at 2:07 am

    Well, you can fix your immediate problem by using //row instead of row, assuming you want row elements at any depth.

    However, HTTParty parses your response for you, so it’s a bit redundant use it just to post a page, if you’re going to parse it a different way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working on a project using Entity Framework (4.3.1.0). I'm trying to figure out how
I´m working with Raphael, and I think that I´m using it in a way
Working on an extension that use the new experimental devtools apis. How do you
Working on a small game using an HTML5 canvas, and javascript. And it's working
Working with an undisclosed API, I found a function that can set the number
I'm currently working on a project using the current if statement and i'm sure
I'm trying to download a PDF file in Struts Action class. Problem is that
Working sample using one Table SELECT t.* FROM ( SELECT TITLE.name, (TITLE.value-TITLE.msp) AS Lower,
Working with a Lucene index, I have a standard document format that looks something
Here is the working code in Python (using cURL): #!/usr/bin/python import pycurl c =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.