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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:07:41+00:00 2026-05-31T21:07:41+00:00

i am unable to parse xml document . well my task was like that

  • 0

i am unable to parse xml document .
well my task was like that

i got xml page from curl which contain ip info

<ip_address>209.59.194.20</ip_address><ip_type>Mapped</ip_type><Network><organization>thoughtconvergence.com</organization><carrier>whidbey internet services</carrier><asn>6295</asn><connection_type/><line_speed/><ip_routing_type>fixed</ip_routing_type><Domain><tld>com</tld><sld>trafficz</sld></Domain></Network><Location><continent>north america</continent><latitude>34.03708</latitude><longitude>-118.42789</longitude><CountryData><country>united states</country><country_code>us</country_code><country_cf>99</country_cf></CountryData><region>southwest</region><StateData><state>california</state><state_code>ca</state_code><state_cf>80</state_cf></StateData><dma>803</dma><msa>31100</msa><CityData><city>los angeles</city><postal_code>90064</postal_code><time_zone>-8</time_zone><area_code>323</area_code><city_cf>61</city_cf></CityData></Location></ipinfo>

i try to parse it

$book = simplexml_load_string($datax);
$ipadd = $book->ip_address;  
$ipatype = $book->ip_type;  
$ip_routing_type = $book->Network->ip_routing_type;  
$state = $book->Location->StateData->state;
$country = $book->Location->CountryData->country;
$continent = $book->Location->continent;   
$region = $book->Location->region;

now am getting few errors
1) Entity: line 2: parser error : Extra content at the end of the document
2 Trying to get property of non-object in line #

  • 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-05-31T21:07:42+00:00Added an answer on May 31, 2026 at 9:07 pm

    Your XML is invalid. It has a closing tag for a root element at the end of the data

    </ipinfo> 
    

    but there is no header tag. If you tack:

    <ipinfo> 
    

    to the front of it I’ll bet it will work.

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

Sidebar

Related Questions

I have this xml feed in Chinese, which NSXLParsers is unable to parse. It
I am unable to parse response recieve using Touch XML My response from SOAP
I am currently trying to read from an xml file which records the jobs
I am trying to parse one XML file that contains some unicode characters.I tried
Currently I am trying to parse an xml string that I already have (no
I have a function that generates XML from a source. It works perfectly however,
I am trying to parse a xml file that i have (using javascript DOM).
I'm using AsyncTask to download and parse XML content from i-net. Downloading and parsing
I need to parse the java-objects which are passed through xml. I want to
From the libxml-ruby API docs ( http://libxml.rubyforge.org/rdoc/index.html ), under LibXML::XML::Document, I tried the following:

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.