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 8990577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:31:46+00:00 2026-06-15T22:31:46+00:00

I am having difficulty effectively parsing XML that I’ve retrieved from Major League Baseball

  • 0

I am having difficulty effectively parsing XML that I’ve retrieved from Major League Baseball (MLB).

First of all, this is a side project intended for me to gain familiarity with XML. I am most familiar with R so I feel I stand a better chance debugging code once I am successful.

I am able to acquire the xml via these lines of code:

xmlurl<-"http://gd2.mlb.com/components/game/mlb/year_2012/month_06/day_11/miniscoreboard.xml"
xmltree<-xmlTreeParse(xmlurl,useInternalNodes=TRUE)

I would love to be able to extract information throughout the XML. For example, for all games played on this day, I would like to extract the number of runs scored by each team (“away_team_runs” & “home_team_runs”). Furthermore, I would like to be able to basically extract anything from the document that I wished yet I am unsuccessful in doing so, so far.

Any pointers would be greatly appreciated.

  • 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-15T22:31:47+00:00Added an answer on June 15, 2026 at 10:31 pm

    e.g , Using xpathSApply

    xpathSApply(xmltree,'//games/*',xmlGetAttr,'away_team_runs') 
    [1] "6" "1" "3" "3"
    xpathSApply(xmltree,'//games/*',xmlGetAttr,'home_team_runs') 
    [1] "3" "4" "0" "2"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having difficulty grabbing data from an XML and putting it into an Array. At
I am having difficulty creating sessions for my mobile application that is written in
I am having difficulty finding a list of all of the inbuilt icons in
I'm having difficulty testing some logic that uses notifications. I've read about enforcing that
I am having difficulty executing a MS SQL Server stored procedure from Java/jsp. I
I'm having difficulty writing a Criteria to select all entities with empty child collections
I'm having difficulty extracting a single node value from a nodelist. My code takes
I'm having difficulty moving an image to another location after the first animation is
I'm having difficulty extracting amplitude data from linear PCM on the iPhone stored in
I'm having difficulty setting up a simple menu that displays results on a div

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.