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.
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>