473,813 Members | 2,927 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

php & xml

Hi,
i am trying to put field from this page in a table,
http://xoap.weather.com/weather/loca...3aa3f76734eadf

i can get the correct data for the current day, but not for the forecast
days <dayf:
<dayf>
<lsup>10/22/07 3:19 PM Local Time</lsup>
- <day d="0" t="Monday" dt="Oct 22">
<hi>N/A</hi>
<low>-1</low>
<sunr>8:02 AM</sunr>
<suns>6:41 PM</suns>
- <part p="d">
<icon>44</icon>
<t>N/A</t>
- <wind>
<s>N/A</s>
<gust>N/A</gust>
<d>N/A</d>
<t>N/A</t>
</wind>
<bt>N/A</bt>
<ppcp>0</ppcp>
<hmid>N/A</hmid>
</part>
- <part p="n">
<icon>31</icon>
<t>Clear</t>
- <wind>
<s>8</s>
<gust>N/A</gust>
<d>360</d>
<t>N</t>
</wind>
<bt>Clear</bt>
<ppcp>0</ppcp>
<hmid>76</hmid>
</part>
</day>
+ <day d="1" t="Tuesday" dt="Oct 23">
......
</day>
....
-<dayf>
f

my code:
$parser = xml_parser_crea te( );
xml_parser_set_ option($parser, XML_OPTION_CASE _FOLDING, 0);
xml_parse_into_ struct($parser, $xml,$values,$i ndex);
xml_parser_free ($parser);
$city = htmlspecialchar s($values[$index['dnam'][0]]['value']);
$unit_temp = $values[$index['ut'][0]]['value'];
$unit_speed = $values[$index['us'][0]]['value'];

I can not get the forecast days (1 to 9) in a correct array..
Do i need to parse again??

Thanks for your help
VooDoo
Oct 23 '07 #1
0 1068

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
11445
by: DrTebi | last post by:
Hello, I have the following problem: I used to "encode" my email address within links, in order to avoid (most) email spiders. So I had a link like this: <a href="mailto:DrTebi@yahoo.com">DrTebi</a> This would work like a regular mailto link in any browser, but wouldn't be visible to spiders if they don't have a function to decode it.
0
2427
by: Thomas Scheffler | last post by:
Hi, I runned in trouble using XALAN for XSL-Transformation. The following snipplet show what I mean: <a href="http://blah.com/?test=test&amp;test2=test2">Test1&amp;</a> <a href="http://blah.com/?test=test&amp;amp;test2=test2">Test2&amp;amp;</a> This results in the following HTML Code:
4
3231
by: johkar | last post by:
When the output method is set to xml, even though I have CDATA around my JavaScript, the operaters of && and < are converted to XML character entities which causes errors in my JavaScript. I know that I could externalize my JavaScript, but that will not be practical throughout this application. Is there any way to get around this issue? Xalan processor. Stripped down stylesheet below along with XHTML output. <?xml version='1.0'?>...
14
5943
by: Arne | last post by:
A lot of Firefox users I know, says they have problems with validation where the ampersand sign has to be written as &amp; to be valid. I don't have Firefox my self and don't wont to install it only because of this, so I hope some of you gurus can enlighten me with this :) In what circumstances can the "&amp;" in the source code be involuntary changed to "&" by a browser when or other software, when editing and uploading the file to the web...
12
10125
by: InvalidLastName | last post by:
We have been used XslTransform. .NET 1.1, for transform XML document, Dataset with xsl to HTML. Some of these html contents contain javascript and links. For example: // javascript if (a &gt; b) ..... // xsl contents abc.aspx?p1=v1&amp;p2=<xsl:value-of select="$v2" />
0
9734
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9607
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10407
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10422
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10139
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7681
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5705
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3030
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.