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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:47:57+00:00 2026-05-13T09:47:57+00:00

I am trying to get to the geo information off the google-picasa API. This

  • 0

I am trying to get to the geo information off the google-picasa API. This is the original XML:

<georss:where>
  <gml:Point>
    <gml:pos>35.669998 139.770004</gml:pos>
  </gml:Point>
</georss:where>

I already have come this far, with:

$ns_geo=$item->children($namespace['georss']);
$geo=$ns_geo->children($namespace['gml']);

var_dump($geo) will output

object(SimpleXMLElement)#34 (1) { 
  ["Point"]=> object(SimpleXMLElement)#30 (1) { 
    ["pos"]=> string(18) "52.373801 4.890935" 
  } 
} 

but

echo (string)$geo->position or (string)$geo->position->pos; 

will give me nothing. Is there something obvious that i am doing wrong?

  • 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-13T09:47:58+00:00Added an answer on May 13, 2026 at 9:47 am

    You could work with XPath and registerXPathNamespace():

    $xml->registerXPathNamespace("georss", "http://www.georss.org/georss");
    $xml->registerXPathNamespace("gml", "http://www.opengis.net/gml");
    $pos = $xml->xpath("/georss:where/gml:Point/gml:pos");
    

    From the docs, emphasis mine:

    registerXPathNamespace […] Creates a prefix/ns context for the next XPath query.

    More ways to handle namespaces in SimpleXML can be found here, for example:
    Stuart Herbert On PHP – Using SimpleXML To Parse RSS Feeds

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

Sidebar

Related Questions

I'm trying to get GeoIP working with hive. I found this: http://www.jointhegrid.com/hive-udf-geo-ip-jtg/index.jsp , which
I'm using Google Places API to get a list of establishment near a geo
I am trying to use the Google Maps API to get the latitude and
Trying to get this expression to work, can someone look at it and tell
I am trying to parse the JSON at this URL: http://maps.googleapis.com/maps/api/geocode/json?address=canada&sensor=false in Objective-C. I'm
I am trying to send JSON object as parameter. localhost:8080/HelloWorldApplication/webresources/helloworld/get/{param} During this process I
I am trying to do some basic geocoding using the google maps API and
I'm trying to use google maps coordinates for use in an XML feed for
I am trying to run this query on http://dbpedia.org/sparql but I get an error
I am trying to get city name based on my geo location. Problem is

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.