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

  • SEARCH
  • Home
  • 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 8725341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:01:12+00:00 2026-06-13T08:01:12+00:00

My second example is the one returning [function getValue] and I’m trying to fix

  • 0

My second example is the one returning [function getValue] and I’m trying to fix it but I can’t see what the problem is.

I’ve been messing around with xmlparse in google scripts, the xml I want to parse keeps all relevant data in the attributes of elements.

Here’s a sample of that xml format: https://api.eveonline.com/account/characters.xml.aspx?keyID=1409941&vCode=xagxMH966J2EQinVpoFOBB5H1UidCwsjoTwtBKhhvMVZWqq6Jio4mkiBwv026Olc

Here’s some code that works (displayed via log [ctrl]+[enter]):

function dialogDisplay() {
  var xmlstring = Xml.parse('<rowset name="characters" key="characterID" columns="name,characterID,corporationName,corporationID"><row name="Jonah Younbrog" characterID="90131303" corporationName="House of Praetor" corporationID="523373135"/><row name="Mador Younbrog" characterID="90149709" corporationName="House of Praetor" corporationID="523373135"/><row name="Marc Younbrog" characterID="747451028" corporationName="House of Praetor" corporationID="523373135"/></rowset>');
  var attributes = xmlstring.getElement().getAttributes();
  for (var i in attributes) {
    Logger.log(attributes[i].getValue());
  }
}

And here’s the code that doesn’t work, it also logs the element names (successfully) and uses nested fors to go through the xml:

function fetchToLogger() {
  var assetURL = "https://api.eveonline.com/account/characters.xml.aspx?keyID=1409941&vCode=xagxMH966J2EQinVpoFOBB5H1UidCwsjoTwtBKhhvMVZWqq6Jio4mkiBwv026Olc";
  var assetstring = UrlFetchApp.fetch(assetURL).getContentText();
  var xmlstring = Xml.parse(assetstring, false);

  var elements = xmlstring.eveapi.result.getElements();
  for (var a in elements) {

    Logger.log(elements[a].getName().getLocalName());

    var attributes = elements[a].getAttributes();
    for (var x in attributes) {

      Logger.log(attributes[x].getValue);
    }

    var subelements = elements[a].getElements();
    for (var b in subelements) {

      Logger.log(subelements[b].getName().getLocalName());

      var subattributes = subelements[b].getAttributes();
      for (var y in attributes) {

        Logger.log(attributes[y].getValue);
      }

    }

  }

}
  • 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-13T08:01:13+00:00Added an answer on June 13, 2026 at 8:01 am

    .getValue is a function. so you should use .getValue()
    For example:

    Logger.log(attributes[x].getValue());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

From this example http://www.senchafiddle.com/#dPZn0 This displays a first panel, then a second one... using
I have say class/ojbect one which I am returning as details. But then there
For example, netbeans has versions like 6.9.1; 7.0.0; 7.1.1 etc. Does the second number
example some array {2,8,9,10,21,32,1,6,3...} first child take (data size / 2) and sort second
I have two example. First is true and second is wrong. It's just different
Can anyone tell me how to format a given number of seconds (for example
Second question of the day but hopefully simple, I just need to change the
In one example from http://leepoint.net/notes-java/data/expressions/precedence.html The following expression 1 + 2 - 3 *
I have been all over this one, and I am just plumb stuck. I
I can't navigate the XML doc programmatically and I need an one-line XPath solution

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.