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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:00:50+00:00 2026-05-30T16:00:50+00:00

According to another question I can select individual XML fields with a YQL query

  • 0

According to another question I can select individual XML fields with a YQL query and it works just fine when I test it:

SELECT statistics.subscriberCount FROM xml
WHERE url='http://gdata.youtube.com/feeds/api/users/{$id}'

However when I try to select individual XML fields from Google’s “unofficial” weather XML API I always get empty results (though SELECT * does work).

I know my understanding of both XML and YQL are not complete but what am I missing? (Here’s my query in the YQL console)

(I have managed to query it using XPATH with the itemPath parameter and SELECT *)

My intended query

SELECT current_conditions FROM xml
WHERE url="http://www.google.com/ig/api?weather=Tbilisi"

Results

<?xml version="1.0" encoding="UTF-8"?>
<query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng"
    yahoo:count="0" yahoo:created="2012-02-27T11:56:15Z" yahoo:lang="en-US">
    <results/>
</query>

Results of SELECT *

<?xml version="1.0" encoding="UTF-8"?>
<query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng"
    yahoo:count="1" yahoo:created="2012-02-27T11:57:18Z" yahoo:lang="en-US">
    <results>
        <xml_api_reply version="1">
            <weather mobile_row="0" mobile_zipped="1" module_id="0"
                row="0" section="0" tab_id="0">
                <forecast_information>
                    <city data="Tbilisi, Tbilisi"/>
                    <postal_code data="Tbilisi"/>
                    <latitude_e6 data=""/>
                    <longitude_e6 data=""/>
                    <forecast_date data="2012-02-27"/>
                    <current_date_time data="1970-01-01 00:00:00 +0000"/>
                    <unit_system data="US"/>
                </forecast_information>
                <current_conditions>
                    <condition data="Overcast"/>
                    <temp_f data="34"/>
                    <temp_c data="1"/>
                    <humidity data="Humidity: 80%"/>
                    <icon data="/ig/images/weather/cloudy.gif"/>
                    <wind_condition data="Wind: NE at 6 mph"/>
                </current_conditions>
                <forecast_conditions>
                    <day_of_week data="Mon"/>
                    <low data="28"/>
                    <high data="37"/>
                    <icon data="/ig/images/weather/mostly_sunny.gif"/>
                    <condition data="Mostly Sunny"/>
                </forecast_conditions>
                <forecast_conditions>
                    <day_of_week data="Tue"/>
                    <low data="30"/>
                    <high data="41"/>
                    <icon data="/ig/images/weather/mostly_sunny.gif"/>
                    <condition data="Mostly Sunny"/>
                </forecast_conditions>
                <forecast_conditions>
                    <day_of_week data="Wed"/>
                    <low data="30"/>
                    <high data="43"/>
                    <icon data="/ig/images/weather/mostly_sunny.gif"/>
                    <condition data="Mostly Sunny"/>
                </forecast_conditions>
                <forecast_conditions>
                    <day_of_week data="Thu"/>
                    <low data="27"/>
                    <high data="43"/>
                    <icon data="/ig/images/weather/mostly_sunny.gif"/>
                    <condition data="Partly Sunny"/>
                </forecast_conditions>
            </weather>
        </xml_api_reply>
    </results>
</query>
  • 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-30T16:00:51+00:00Added an answer on May 30, 2026 at 4:00 pm

    It turns out not to be anything special about the Google weather API but about how the SELECT parameter interacts with the itemPath parameter in a YQL query.

    Personally I find the YQL documentation quite difficult to use for those of us with only a rudimentary understanding of some of the technologies on which it relies.

    It seems that when you SELECT ... FROM rss that there is an implied itemPath which points to the repeated item field of a feed. But when you SELECT ... FROM xml you need to specify an itemPath manually. If there’s no repeating part of your XML it’s pretty arbitrary what you set it to.

    Now once you have an itemPath set you can then SELECT particular fields using the dot notation. Note that you can specify subfields which are XML attributes using the SELECT dot notation, but you cannot specify them using the slash notation in the itemPath but no diagnostics help you find such a beginner error…

    My new query

    SELECT current_conditions.temp_c.data FROM xml
    WHERE url="http://www.google.com/ig/api?weather=Tbilisi"
    AND itemPath="//weather"
    

    Results

    <?xml version="1.0" encoding="UTF-8"?>
    <query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng"
        yahoo:count="1" yahoo:created="2012-03-01T10:22:41Z" yahoo:lang="en-US">
        <results>
            <weather>
                <current_conditions>
                    <temp_c data="3"/>
                </current_conditions>
            </weather>
        </results>
    </query>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to another question, you can view your skin with this code: <applet code=net.minecraft.skintest.ModelPreviewApplet
According to this answer on another question, the Collapsed event of a ContextMenu is
I don't think this is not another resize iframe according to content height question.
According to JAVA documentation , Connection#commit() can throw SQLException . My question is whether
I would like to base one component's x and y cooridnates according to another,
According to select name from system_privilege_map System has been granted: SELECT ANY TABLE ...and
According to what I have found so far, I can use the following code:
According to the answers to this question, I cannot embed a file version in
This might be a noob question, but can't find an answer anywhere. I have
This is a silly question, but I can't seem to wrap my head around

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.