Re: arrays
| From: | Peter Clarke | Date: | Fri, 21 Dec 2001 18:26:20 +0000 |
| Subject: | Re: arrays | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-78661@lists.php.net to get a copy of this message | ||
The best thing for converting XML to HTML is XSLT (that's what it was made
for). PHP can do the convertion using the XSLT functions (which require
Sablotron):
http://www.php.net/manual/ref.xslt.php
Peter
"Php Dood" <bryan@integrityol.com> wrote in message
news:20011221010719.96040.qmail@pb1.pair.com...
> I'm trying to figure out how to parse an xml document, and convert it into
> html...
> i know how to parse in simple xml stuff for example
> <easy>easy</easy> is pretty easy to parse in, and i know how to code that,
> but when you start adding flags that i'm going to need variables for,
> example <easy does="1" it="2">easy</easy> is not so easy.
>
> ***
> paste sample xml
> ***
> <report gmt_date="1206082001" unix_date="992001907.000000">
>
> <location city="11531">
> <forecast day_sequence="1" day_of_week="6" daylight="D"
> date="060801" high_temp="24.78" low_temp="14.51"
> sky_desc="3"
> precip_desc="*" temp_desc="8" air_desc="*" uv_index="7"
> wind_speed="18.51" wind_dir="270" humidity="48"
> dew_point="12.01"
> comfort="25.28" rainfall="*" snowfall="*"
> precip_prob="0" icon="2" />
> <forecast day_sequence="2" day_of_week="7" daylight="D"
> date="060901" high_temp="20.34" low_temp="13.68"
> sky_desc="1"
> precip_desc="*" temp_desc="7" air_desc="20"
> uv_index="7"
> wind_speed="18.51" wind_dir="270" humidity="57"
> dew_point="9.23"
> comfort="19.23" rainfall="*" snowfall="*"
> precip_prob="2" icon="1" />
> <forecast day_sequence="3" day_of_week="1" daylight="D"
> date="061001" high_temp="20.35" low_temp="12.01"
> sky_desc="3"
> precip_desc="*" temp_desc="7" air_desc="*" uv_index="7"
> wind_speed="*" wind_dir="*" humidity="56"
> dew_point="9.80"
> comfort="*" rainfall="*" snowfall="*" precip_prob="1"
> icon="2" />
> <forecast day_sequence="4" day_of_week="2" daylight="D"
> date="061101" high_temp="20.34" low_temp="12.02"
> sky_desc="3"
> precip_desc="*" temp_desc="7" air_desc="*" uv_index="7"
> wind_speed="*" wind_dir="*" humidity="57"
> dew_point="10.34"
> comfort="*" rainfall="*" snowfall="*" precip_prob="1"
> icon="2" />
> <forecast day_sequence="5" day_of_week="3" daylight="D"
> date="061201" high_temp="22.01" low_temp="13.12"
> sky_desc="3"
> precip_desc="*" temp_desc="7" air_desc="*" uv_index="7"
> wind_speed="*" wind_dir="*" humidity="55"
> dew_point="11.45"
> comfort="*" rainfall="*" snowfall="*" precip_prob="1"
> icon="2" />
> <forecast day_sequence="6" day_of_week="4" daylight="D"
> date="061301" high_temp="23.12" low_temp="13.12"
> sky_desc="7"
> precip_desc="*" temp_desc="7" air_desc="*" uv_index="7"
> wind_speed="*" wind_dir="*" humidity="46"
> dew_point="9.79"
> comfort="*" rainfall="*" snowfall="*" precip_prob="2"
> icon="2" />
> <forecast day_sequence="7" day_of_week="5" daylight="D"
> date="061401" high_temp="23.12" low_temp="13.68"
> sky_desc="7"
> precip_desc="*" temp_desc="7" air_desc="*" uv_index="7"
> wind_speed="*" wind_dir="*" humidity="49"
> dew_point="10.34"
> comfort="*" rainfall="*" snowfall="*" precip_prob="3"
> icon="2" />
> </location>
>
>