Quantcast
Channel: Internet Explorer Web Development forum
Viewing all articles
Browse latest Browse all 3527

How do I find the data type for a given element in an XML hierarchy?

$
0
0

How do I find the data type for a given element in an XML hierarchy?

What I want is to know the data types of each element in the XML structure.  One way is to have attributes that tell you the name and type, as shown here. 

<xs:element name="xxx" type="yyy"/>

However, when this information is not provided, can it be retrieved from somewhere else?  For example, this is a link to the National Weather Service web service that finds the max temperatures at a specific location.

https://graphical.weather.gov/xml/SOAP_server/ndfdXMLclient.php?whichClient=NDFDgenMultiZipCode&lat=&lon=&listLatLon=&lat1=&lon1=&lat2=&lon2=&resolutionSub=&listLat1=&listLon1=&listLat2=&listLon2=&resolutionList=&endPoint1Lat=&endPoint1Lon=&endPoint2Lat=&endPoint2Lon=&listEndPoint1Lat=&listEndPoint1Lon=&listEndPoint2Lat=&listEndPoint2Lon=&zipCodeList=77357&listZipCodeList=&centerPointLat=&centerPointLon=&distanceLat=&distanceLon=&resolutionSquare=&listCenterPointLat=&listCenterPointLon=&listDistanceLat=&listDistanceLon=&listResolutionSquare=&citiesLevel=&listCitiesLevel=&sector=&gmlListLatLon=&featureType=&requestedTime=&startTime=&endTime=&compType=&propertyName=&product=glance&begin=2019-11-18T00%3A00%3A00&end=2023-11-18T00%3A00%3A00&Unit=e&maxt=maxt&Submit=Submit

Looking at an extract of that complete XML, let's focus on the header.  Is there a way, using one of the three namespace links to go look up the data structure and find the data type for the <creation-date> element?  Obviously, its a date time format.  However, if I am programmatically processing the XML, the program won't be able to apply the human-eye test.  It can treat this as a text value.  What I am hoping to find is where in the schema (or other source) that it says <creation-date type="datetime"> or equivalent.

This is the extract...

<?xmlversion="1.0"?>

<dwmlxsi:noNamespaceSchemaLocation="https://graphical.weather.gov/xml/DWMLgen/schema/DWML.xsd"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:xsd="http://www.w3.org/2001/XMLSchema"version="1.0">

  <head>

   <productoperational-mode="official"concise-name="glance"srsName="WGS 1984">

      <title>NOAA's National Weather Service Forecast at a Glance</title>

      <field>meteorological</field>

      <category>forecast</category>

      <creation-daterefresh-frequency="PT1H">2019-11-18T14:51:34Z</creation-date>

    </product>

  </dwml>


Viewing all articles
Browse latest Browse all 3527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>