Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Nat. Weather Service DTD/Schema issue?

Status
Not open for further replies.

stevecrozz

IS-IT--Management
Jul 4, 2005
20
US
This XML feed comes straight from NOAA, I need to transform it via XSLT. Here's my blank stylesheet:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="</xsl:stylesheet>

Nothing special, but I get this error:
"The element 'current_observation' is used but not declared in the DTD/Schema."

what is the cause of this error? seems to be a valid DTD is it not?

Here's the XML::

<?xml version="1.0" encoding="ISO-8859-1"?>
<current_observation version="1.0"
xmlns:xsd=" xmlns:xsi=" xsi:noNamespaceSchemaLocation=" <credit>NOAA's National Weather Service</credit>
<credit_URL> <image>
<url> <title>NOAA's National Weather Service</title>
<link> </image>
<suggested_pickup>15 minutes after the hour</suggested_pickup>
<suggested_pickup_period>60</suggested_pickup_period>
<location>Fresno Air Terminal, CA</location>
<station_id>KFAT</station_id>
<latitude>36.46.48N</latitude>
<longitude>119.43.10W</longitude>
<observation_time>Last Updated on Jul 19, 1:56 pm PDT</observation_time>
<observation_time_rfc822>Wed, 19 Jul 2006 13:56:00 -0700 PDT</observation_time_rfc822>
<weather>Partly Cloudy</weather>
<temperature_string>103 F (39 C)</temperature_string>
<temp_f>103</temp_f>
<temp_c>39</temp_c>
<relative_humidity>22</relative_humidity>
<wind_string>From the North at 8 MPH</wind_string>
<wind_dir>North</wind_dir>
<wind_degrees>350</wind_degrees>
<wind_mph>8.05</wind_mph>
<wind_gust_mph>NA</wind_gust_mph>
<pressure_string>29.81&quot; (1009.0 mb)</pressure_string>
<pressure_mb>1009.0</pressure_mb>
<pressure_in>29.81</pressure_in>
<dewpoint_string>57 F (14 C)</dewpoint_string>
<dewpoint_f>57</dewpoint_f>
<dewpoint_c>14</dewpoint_c>
<heat_index_string>102 F (39 C)</heat_index_string>
<heat_index_f>102</heat_index_f>
<heat_index_c>39</heat_index_c>
<windchill_string>NA</windchill_string>
<windchill_f>NA</windchill_f>
<windchill_c>NA</windchill_c>
<visibility_mi>10.00</visibility_mi>
<icon_url_base> <icon_url_name>sct.jpg</icon_url_name>
<two_day_history_url> <ob_url> <disclaimer_url> <copyright_url> <privacy_policy_url></current_observation>
 
solution: malformed XSD at the NOAA, I'm working with them on it now.
 
So, can you make it stop validating? You have learned that many documents in current use are not schema valid. If the document suits your purposes, why waste the time doing a schema validation?

Tom Morrison
 
Well, I can remove the line after I get it, but thats one extra step to take. I don't control the way the national weather service sends their xml. They specify a schema in their XML, why should I have to write a script to remove that line when I can just ask them to fix it?

Besides it will be better for everyone who uses their service if they don't have malformed schemas.
 
I'm using cooktop for testing right now, do you have a better suggestion? It was just the first thing I found that works.

The solution will be implemented in PERL using XML::XSLT module.
 
I do not have the documentation for Cooktop, but it would seem like there might be a setting to stop the schema validation.

It might be the case that XML::XSLT still uses the XML::DOM::parser nonvalidating parser, it which case all of this issue will go away.

Tom Morrison
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top