xml and related technologies tutorial developed using material at w3schools/xml

31
XML and related technologies tutorial XML and related technologies tutorial Developed using material at Developed using material at http://www.w3schools.com/xml http://www.w3schools.com/xml

Upload: elyse

Post on 15-Jan-2016

44 views

Category:

Documents


1 download

DESCRIPTION

XML and related technologies tutorial Developed using material at http://www.w3schools.com/xml. Topics covered XML (.xml)– describe data XML Schema (.xsd)– validate data XPATH – navigate data XSLT (.xsl) – transform data. XML (.xml)– describe data - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: XML and related technologies tutorial Developed using material at w3schools/xml

XML and related technologies tutorialXML and related technologies tutorial

Developed using material atDeveloped using material at

http://www.w3schools.com/xmlhttp://www.w3schools.com/xml

Page 2: XML and related technologies tutorial Developed using material at w3schools/xml

Topics coveredTopics covered

XML (.xml)– describe dataXML (.xml)– describe data

XML Schema (.xsd)– validate dataXML Schema (.xsd)– validate data

XPATH – navigate dataXPATH – navigate data

XSLT (.xsl) – transform dataXSLT (.xsl) – transform data

Page 3: XML and related technologies tutorial Developed using material at w3schools/xml

XML (.xml)– describe dataXML (.xml)– describe data

• XML stands for Extensible Markup Language.XML stands for Extensible Markup Language.

• XML is a XML is a markup languagemarkup language much like HTML much like HTML

• XML was designed to XML was designed to describe datadescribe data

• XML tags are not predefined. You must XML tags are not predefined. You must define your own tagsdefine your own tags

• XML uses an XML uses an XML Schema(.xsd)XML Schema(.xsd) to validate to validate the data (or the data (or Document Type DefinitionDocument Type Definition (.dtd), …)(.dtd), …)

• XML with a XML Schema is designed to be XML with a XML Schema is designed to be self-descriptiveself-descriptive

• XML can be used to create other XML based XML can be used to create other XML based languages languages

Page 4: XML and related technologies tutorial Developed using material at w3schools/xml

XML pros/consXML pros/cons

FormatFormat

• Pro - Data and data description tags are written in Pro - Data and data description tags are written in text so they are portable and not dependent on text so they are portable and not dependent on proprietary formats or conversion processes for use.proprietary formats or conversion processes for use.

• Con – because data is verbosely described, larger Con – because data is verbosely described, larger datasets(e.g. model outputs) or binary formats(e.g. datasets(e.g. model outputs) or binary formats(e.g. images) can be poor candidates for pure xml images) can be poor candidates for pure xml adoption. The common solution is to leave these adoption. The common solution is to leave these types of data in their raw formats with use of some types of data in their raw formats with use of some xml to describe the useful metadata(observation xml to describe the useful metadata(observation type, temporal/spatial range,…) of the file.type, temporal/spatial range,…) of the file.

StructureStructure• Pro - XML structure can be easily Pro - XML structure can be easily extendedextended with the with the

addition of elements/attributes as needed. addition of elements/attributes as needed. • Con – deciding on the initial XML structure is driven Con – deciding on the initial XML structure is driven

by the application use of the data which can vary by the application use of the data which can vary widely.widely.

Page 5: XML and related technologies tutorial Developed using material at w3schools/xml

XML SyntaxXML Syntax

<note id=“100”><note id=“100”>

<!-- this is a comment --><!-- this is a comment -->

<to>John</to><to>John</to>

<from>Jane</from><from>Jane</from>

<heading>Reminder</heading><heading>Reminder</heading>

<body>Don't forget me this weekend!</body><body>Don't forget me this weekend!</body>

</note> </note>

• <note> is the ‘root’ element of the document. <note> is a <note> is the ‘root’ element of the document. <note> is a parent element, <body> is a child element and <heading> is a parent element, <body> is a child element and <heading> is a sibling element.sibling element.

• id=“100” is an attribute of the <note> element. Attribute use id=“100” is an attribute of the <note> element. Attribute use should be limited, but is generally considered ok when referring should be limited, but is generally considered ok when referring to element metadata. to element metadata.

• All elements must have a closing tag and be properly nested.All elements must have a closing tag and be properly nested.• Tags are case sensitive.Tags are case sensitive.• Attribute values must be quoted.Attribute values must be quoted.

Page 6: XML and related technologies tutorial Developed using material at w3schools/xml

Element NamingElement Naming

XML elements must follow these naming XML elements must follow these naming rules:rules:

• Names can contain letters, numbers, and Names can contain letters, numbers, and other characters other characters

• Names must not start with a number or Names must not start with a number or punctuation character punctuation character

• Names must not start with the letters xml (or Names must not start with the letters xml (or XML or Xml …) XML or Xml …)

• Names cannot contain spaces(substitute Names cannot contain spaces(substitute underscore(_) instead) and should not use the underscore(_) instead) and should not use the colon(:) or dash(-) characterscolon(:) or dash(-) characters

Page 7: XML and related technologies tutorial Developed using material at w3schools/xml

XML Schema (.xsd)– validate dataXML Schema (.xsd)– validate data

• defines elements that can appear in a defines elements that can appear in a document document

• defines attributes that can appear in a defines attributes that can appear in a document document

• defines which elements are child elements defines which elements are child elements

• defines the order of child elements defines the order of child elements

• defines the number of child elements defines the number of child elements

• defines whether an element is empty or can defines whether an element is empty or can include text include text

• defines data types for elements and attributes defines data types for elements and attributes

• defines default and fixed values for elements defines default and fixed values for elements and attributes and attributes

Page 8: XML and related technologies tutorial Developed using material at w3schools/xml

• <employee><employee>• <firstname>John</firstname><firstname>John</firstname>• <lastname>Smith</lastname><lastname>Smith</lastname>• </employee></employee>

Several elements can refer to the same complex type Several elements can refer to the same complex type • <xs:element name="employee" type="personinfo"/><xs:element name="employee" type="personinfo"/>• <xs:element name="student" type="personinfo"/><xs:element name="student" type="personinfo"/>• <xs:element name="member" type="personinfo"/><xs:element name="member" type="personinfo"/>

• <xs:complexType name="personinfo"><xs:complexType name="personinfo">• <xs:sequence><xs:sequence>• <xs:element name="firstname" type="xs:string"/><xs:element name="firstname" type="xs:string"/>• <xs:element name="lastname" type="xs:string"/><xs:element name="lastname" type="xs:string"/>• </xs:sequence></xs:sequence>• </xs:complexType></xs:complexType>

Page 9: XML and related technologies tutorial Developed using material at w3schools/xml

XPath – navigate dataXPath – navigate data

• XPath is a syntax for defining parts of an XML XPath is a syntax for defining parts of an XML document document

• XPath uses path expressions to navigate in XPath uses path expressions to navigate in XML documents XML documents

• XPath contains a library of standard functions XPath contains a library of standard functions

• XPath is a major element in XSLT XPath is a major element in XSLT

Page 10: XML and related technologies tutorial Developed using material at w3schools/xml

• #file obs_system.xml#file obs_system.xml

• <?xml version="1.0"?><?xml version="1.0"?>• <system id="carocoops"><system id="carocoops">• <platform id="CAP2"><platform id="CAP2">• <online>no</online><online>no</online>• <latitude_dd></latitude_dd><latitude_dd></latitude_dd>• <longitude_dd></longitude_dd><longitude_dd></longitude_dd>• <observation id="air_pressure"><observation id="air_pressure">• <online>yes</online><online>yes</online>• <unit>bar</unit><unit>bar</unit>• <last_timestamp></last_timestamp><last_timestamp></last_timestamp>• <last_measurement></last_measurement><last_measurement></last_measurement>• <range_fail_high>1050</range_fail_high><range_fail_high>1050</range_fail_high>• <range_fail_low>900</range_fail_low><range_fail_low>900</range_fail_low>• <continuity_fail></continuity_fail><continuity_fail></continuity_fail>• </observation></observation>• </platform></platform>• <platform id="SUN2"><platform id="SUN2">• <online>yes</online><online>yes</online>• <latitude_dd></latitude_dd><latitude_dd></latitude_dd>• <longitude_dd></longitude_dd><longitude_dd></longitude_dd>• <observation id="air_pressure"><observation id="air_pressure">• <online>yes</online><online>yes</online>• <unit>bar</unit><unit>bar</unit>• <last_timestamp></last_timestamp><last_timestamp></last_timestamp>• <last_measurement></last_measurement><last_measurement></last_measurement>• <range_fail_high>1050</range_fail_high><range_fail_high>1050</range_fail_high>• <range_fail_low>900</range_fail_low><range_fail_low>900</range_fail_low>• <continuity_fail></continuity_fail><continuity_fail></continuity_fail>• </observation></observation>• </platform></platform>• </system></system>

Page 11: XML and related technologies tutorial Developed using material at w3schools/xml

• #!perl#!perl

• use strict;use strict;

• use XML::XPath;use XML::XPath;

• my $xp = XML::XPath->new(filename => my $xp = XML::XPath->new(filename => 'obs_system.xml');'obs_system.xml');

• foreach my $element foreach my $element ($xp->findnodes('/system/platform[@id="SU($xp->findnodes('/system/platform[@id="SUN2"]/online')) {N2"]/online')) {

• print $element->string_value()."\n";print $element->string_value()."\n";

• }}

Page 12: XML and related technologies tutorial Developed using material at w3schools/xml

XSLT (.xsl) – transform dataXSLT (.xsl) – transform data

• XSL stands for EXtensible Stylesheet XSL stands for EXtensible Stylesheet Language.Language.

• XSLT stands for XSL TransformationsXSLT stands for XSL Transformations

• XSLT is the most important part of XSLXSLT is the most important part of XSL

• XSLT transforms an XML document into XSLT transforms an XML document into another XML document or output(see another XML document or output(see xsl:output method="text")xsl:output method="text")

• XSLT uses XPath to navigate in XML XSLT uses XPath to navigate in XML documentsdocuments

Page 13: XML and related technologies tutorial Developed using material at w3schools/xml

• <?xml version="1.0" encoding="ISO-8859-1"?><?xml version="1.0" encoding="ISO-8859-1"?>

• <?xml-stylesheet type="text/xsl" <?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?>href="cdcatalog.xsl"?>

• <catalog><catalog>

• <cd><cd>

• <title>Empire Burlesque</title><title>Empire Burlesque</title>

• <artist>Bob Dylan</artist><artist>Bob Dylan</artist>

• <country>USA</country><country>USA</country>

• <company>Columbia</company><company>Columbia</company>

• <price>10.90</price><price>10.90</price>

• <year>1985</year><year>1985</year>

• </cd></cd>

• ......

• </catalog></catalog>

Page 14: XML and related technologies tutorial Developed using material at w3schools/xml

• <?xml version="1.0" encoding="ISO-8859-1"?><?xml version="1.0" encoding="ISO-8859-1"?>

• <xsl:stylesheet version="1.0"<xsl:stylesheet version="1.0"• xmlns:xsl="http://www.w3.org/1999/XSL/Transform">xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

• <xsl:template match="/"><xsl:template match="/">• <html><html>• <body><body>• <h2>My CD Collection</h2><h2>My CD Collection</h2>• <table border="1"><table border="1">• <tr bgcolor="#9acd32"><tr bgcolor="#9acd32">• <th align="left">Title</th><th align="left">Title</th>• <th align="left">Artist</th><th align="left">Artist</th>• </tr></tr>• <xsl:for-each select="catalog/cd"><xsl:for-each select="catalog/cd">• <tr><tr>• <td><xsl:value-of select="title"/></td><td><xsl:value-of select="title"/></td>• <td><xsl:value-of select="artist"/></td><td><xsl:value-of select="artist"/></td>• </tr></tr>• </xsl:for-each></xsl:for-each>• </table></table>• </body></body>• </html></html>• </xsl:template></xsl:template>

• </xsl:stylesheet></xsl:stylesheet>

Page 15: XML and related technologies tutorial Developed using material at w3schools/xml
Page 16: XML and related technologies tutorial Developed using material at w3schools/xml

Salinity WorkshopSalinity Workshop

PossiblePossible

Web services which return dataWeb services which return data

IOOS XML Schema for data returnedIOOS XML Schema for data returned

Salty Slim – more documentation at Salty Slim – more documentation at http://twiki.sura.org/twiki/bin/view/Main/Salinihttp://twiki.sura.org/twiki/bin/view/Main/SalinityWorkshoptyWorkshop

Same set of possible web services could also be Same set of possible web services could also be used by generalized observing systems(NEON used by generalized observing systems(NEON or GEOSS) or as example for USGS, NDBC, or GEOSS) or as example for USGS, NDBC, OBIS, etc web servicesOBIS, etc web services

Page 17: XML and related technologies tutorial Developed using material at w3schools/xml

• Possible web servicesPossible web services

• ##tell me the services you offer ##tell me the services you offer

# GetCapabilities# GetCapabilities

• returns a list of methods available with returns a list of methods available with their associated input vars and outputs.their associated input vars and outputs.

•• ##give me reference handles to the ##give me reference handles to the

platforms, their position and what they collectplatforms, their position and what they collect

# GetPlatformList# GetPlatformList

• returns list of platform_id's and their returns list of platform_id's and their associated geographic position and associated geographic position and observation type(standard_names) which they observation type(standard_names) which they collectcollect

Page 18: XML and related technologies tutorial Developed using material at w3schools/xml

• ##########• ##give me all the data##give me all the data# GetLatest(optional: platform_id/bounding_box)# GetLatest(optional: platform_id/bounding_box)• returns a list of platform_id's and their corresponding latest returns a list of platform_id's and their corresponding latest

observations(optionally for a specific platform_id/within the selected geographic observations(optionally for a specific platform_id/within the selected geographic bounding_box)bounding_box)

• ##give me just the observations requested##give me just the observations requested# GetLatestByObservation(observation_standard_name[list?], optional: # GetLatestByObservation(observation_standard_name[list?], optional:

platform_id/bounding_box)platform_id/bounding_box)• returns a list of platform_id's and only the selected observation[list?] for returns a list of platform_id's and only the selected observation[list?] for

the latest data(optionally for a specific platform_id/within the selected geographic the latest data(optionally for a specific platform_id/within the selected geographic bounding_box)bounding_box)

• ##########• ##instead of just the latest data, give me for the specified date range ##instead of just the latest data, give me for the specified date range • ##give me all the data##give me all the data# GetByDateRange(optional: platform_id/bounding_box, start_datetime, # GetByDateRange(optional: platform_id/bounding_box, start_datetime,

end_datetime)end_datetime)• returns a list of platform_id's and and observations for data within the returns a list of platform_id's and and observations for data within the

date range(optionally for a specific platform_id/within the selected geographic date range(optionally for a specific platform_id/within the selected geographic bounding_box)bounding_box)

• ##give me just the observations requested##give me just the observations requested# GetByDateRangeByObservation(observation_standard_name[list?], optional: # GetByDateRangeByObservation(observation_standard_name[list?], optional:

platform_id/bounding_box, start_datetime, end_datetime)platform_id/bounding_box, start_datetime, end_datetime)• returns a list of platform_id's and only the selected observation[list?] for returns a list of platform_id's and only the selected observation[list?] for

data within the date range(optionally for a specific platform_id/within the selected data within the date range(optionally for a specific platform_id/within the selected geographic bounding_box)geographic bounding_box)

Page 19: XML and related technologies tutorial Developed using material at w3schools/xml

• Salty Slim – more documentation at Salty Slim – more documentation at http://twiki.sura.org/twiki/bin/view/Main/SalinityWorkshophttp://twiki.sura.org/twiki/bin/view/Main/SalinityWorkshop

• <?xml version="1.0"?><?xml version="1.0"?>• <ioos_data <ioos_data • xmlns="http://localhost/xml_schema" xmlns="http://localhost/xml_schema" • xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" • xsi:schemaLocation="http://10.203.10.47/xml_schema xsi:schemaLocation="http://10.203.10.47/xml_schema

ioos_sst.xsd">ioos_sst.xsd">• • <organization><organization>• <name>ndbc</name><name>ndbc</name>• <url>http://www.ndbc.noaa.gov</url><url>http://www.ndbc.noaa.gov</url>• •

<spatial_reference_system>NameOfReferenceSystem</spatial<spatial_reference_system>NameOfReferenceSystem</spatial_reference_system>_reference_system>

• <srs_units>meters</srs_units><srs_units>meters</srs_units>• <vertical_datum>NGVD88</vertical_datum><vertical_datum>NGVD88</vertical_datum>• <horizontal_datum>NAD83</horizontal_datum><horizontal_datum>NAD83</horizontal_datum>

Page 20: XML and related technologies tutorial Developed using material at w3schools/xml

<platform><platform> <name>41004</name><name>41004</name> <id>ndbc_41004</id><id>ndbc_41004</id> <!-- fixed_point,fixed_profile,fixed_depth,free --><!-- fixed_point,fixed_profile,fixed_depth,free -->

<collection_type>fixed_point</collection_type> <collection_type>fixed_point</collection_type> <fixed_latitude>32.50</fixed_latitude><fixed_latitude>32.50</fixed_latitude> <fixed_longitude>-79.09</fixed_longitude><fixed_longitude>-79.09</fixed_longitude> <fixed_depth units="meters">2.5</depth><fixed_depth units="meters">2.5</depth> <url>http://www.ndbc.noaa.gov/station_page.php?<url>http://www.ndbc.noaa.gov/station_page.php?

station=41004</url>station=41004</url><fgdc_metadata_url>http://url_to_metadata</fgdc_metadata_url><fgdc_metadata_url>http://url_to_metadata</fgdc_metadata_url><opendap_url>http://url_to_opendap</opendap_url><opendap_url>http://url_to_opendap</opendap_url><qc_documentation_url>http://url_to_qc_documentation</<qc_documentation_url>http://url_to_qc_documentation</

qc_documentation_url>qc_documentation_url> <upload_interval units='minutes'>10</upload_interval><upload_interval units='minutes'>10</upload_interval>

Page 21: XML and related technologies tutorial Developed using material at w3schools/xml

• <data><data>• <observation><observation>• <name>sstPrimary</name><name>sstPrimary</name>• <id>ndbc_41004_sstPrimary</id><id>ndbc_41004_sstPrimary</id>• <standard_name>sea_surface_temperature</standard_name><standard_name>sea_surface_temperature</standard_name>• <units>degree_Celsius</units><units>degree_Celsius</units>• <measurement_interval units='seconds'>30</measurement_interval><measurement_interval units='seconds'>30</measurement_interval>

• <value datetime="2001-01-01T00:00:00" qc_stage="raw" <value datetime="2001-01-01T00:00:00" qc_stage="raw" qc_flags="none">20.6</value>qc_flags="none">20.6</value>

• <value datetime="2001-01-01T01:00:00" qc_stage="raw" <value datetime="2001-01-01T01:00:00" qc_stage="raw" qc_flags="none">20.6</value>qc_flags="none">20.6</value>

• <value datetime="2001-01-01T02:00:00" qc_stage="raw" <value datetime="2001-01-01T02:00:00" qc_stage="raw" qc_flags="none">20.6</value>qc_flags="none">20.6</value>

• <value datetime="2001-01-01T03:00:00" qc_stage="raw" <value datetime="2001-01-01T03:00:00" qc_stage="raw" qc_flags="none">20.6</value>qc_flags="none">20.6</value>

• <value datetime="2001-01-01T04:00:00" qc_stage="raw" <value datetime="2001-01-01T04:00:00" qc_stage="raw" qc_flags="none">20.6</value>qc_flags="none">20.6</value>

• <value datetime="2001-01-01T05:00:00" qc_stage="raw" <value datetime="2001-01-01T05:00:00" qc_stage="raw" qc_flags="none">20.4</value>qc_flags="none">20.4</value>

• <value datetime="2001-01-01T06:00:00" qc_stage="raw" <value datetime="2001-01-01T06:00:00" qc_stage="raw" qc_flags="none">20.4</value>qc_flags="none">20.4</value>

• </observation></observation>• </data></data>• </platform></platform>• </organization></organization>• </ioos_data></ioos_data>

Page 22: XML and related technologies tutorial Developed using material at w3schools/xml

• *fixed_profile(wls,adcp,ctd) - <fixed_latitude), <fixed_longitude> with free_depth *fixed_profile(wls,adcp,ctd) - <fixed_latitude), <fixed_longitude> with free_depth represented on a per <value> attribute basis. <fixed_depth> omitted.represented on a per <value> attribute basis. <fixed_depth> omitted.

<value datetime="2001-01-01T00:00:00" free_depth="2.3" qc_stage="raw" <value datetime="2001-01-01T00:00:00" free_depth="2.3" qc_stage="raw" qc_flags="none">20.6</value>qc_flags="none">20.6</value>

<value datetime="2001-01-01T00:00:00" free_depth="2.1" qc_stage="raw" <value datetime="2001-01-01T00:00:00" free_depth="2.1" qc_stage="raw" qc_flags="none">21.6</value>qc_flags="none">21.6</value>

• *fixed_depth(ships, floaters) - <fixed_depth> with free_latitude, free_longitude *fixed_depth(ships, floaters) - <fixed_depth> with free_latitude, free_longitude represented on a per <value> attribute basis. <fixed_latitude>,<fixed_longitude> represented on a per <value> attribute basis. <fixed_latitude>,<fixed_longitude> omitted.omitted.

<value datetime="2001-01-01T00:00:00" free_latitude="32.60" free_longitude = "-<value datetime="2001-01-01T00:00:00" free_latitude="32.60" free_longitude = "-79.19" qc_stage="raw" qc_flags="none">20.6</value>79.19" qc_stage="raw" qc_flags="none">20.6</value>

<value datetime="2001-01-01T00:00:00" free_latitude="32.70" free_longitude = "-<value datetime="2001-01-01T00:00:00" free_latitude="32.70" free_longitude = "-79.29" qc_stage="raw" qc_flags="none">21.6</value>79.29" qc_stage="raw" qc_flags="none">21.6</value>

• *free(subs, tagged species) - 'free_latitude', 'free_longitude', 'free_depth' *free(subs, tagged species) - 'free_latitude', 'free_longitude', 'free_depth'

represented on a per <value> attribute basis. represented on a per <value> attribute basis. <fixed_latitude>,<fixed_longitude>,<fixed_depth> omitted.<fixed_latitude>,<fixed_longitude>,<fixed_depth> omitted.

<value datetime="2001-01-01T00:00:00" free_latitude="32.60" free_longitude = "-<value datetime="2001-01-01T00:00:00" free_latitude="32.60" free_longitude = "-79.19" free_depth="2.3" qc_stage="raw" qc_flags="none">20.6</value>79.19" free_depth="2.3" qc_stage="raw" qc_flags="none">20.6</value>

<value datetime="2001-01-01T00:00:00" free_latitude="32.70" free_longitude = "-<value datetime="2001-01-01T00:00:00" free_latitude="32.70" free_longitude = "-79.29" free_depth="2.3" qc_stage="raw" qc_flags="none">21.6</value>79.29" free_depth="2.3" qc_stage="raw" qc_flags="none">21.6</value>

• Technically speaking, everything could be represented in the 'free' type format, but Technically speaking, everything could be represented in the 'free' type format, but it might be useful from a metadata/processing standpoint to know what the it might be useful from a metadata/processing standpoint to know what the collection type is.collection type is.

Page 23: XML and related technologies tutorial Developed using material at w3schools/xml
Page 24: XML and related technologies tutorial Developed using material at w3schools/xml

• #the following URL (which is the same as 'GetLatest') supports the Carolinas coast website latest #the following URL (which is the same as 'GetLatest') supports the Carolinas coast website latest observationsobservations

• http://nautilus.baruch.sc.edu/wfs/seacoos_in_situ?http://nautilus.baruch.sc.edu/wfs/seacoos_in_situ?SERVICE=WFS&VERSION=1.0.0&REQUEST=GETFEATURE&BBOX=-91.5,22,-SERVICE=WFS&VERSION=1.0.0&REQUEST=GETFEATURE&BBOX=-91.5,22,-71.5,36.5&typename=latest_in_situ_obs71.5,36.5&typename=latest_in_situ_obs

• #returns the following XML document (only one platform listing shown)#returns the following XML document (only one platform listing shown)

• <?xml version="1.0" encoding="ISO-8859-1" ?> <?xml version="1.0" encoding="ISO-8859-1" ?> • - <wfs:FeatureCollection xmlns="http://www.ttt.org/myns" xmlns:myns="http://www.ttt.org/myns" - <wfs:FeatureCollection xmlns="http://www.ttt.org/myns" xmlns:myns="http://www.ttt.org/myns"

xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs ../wfs/1.0.0/WFS-basic.xsd http://www.ttt.org/myns xsi:schemaLocation="http://www.opengis.net/wfs ../wfs/1.0.0/WFS-basic.xsd http://www.ttt.org/myns http://nautilus.baruch.sc.edu/wfs/seacoos_in_situ?http://nautilus.baruch.sc.edu/wfs/seacoos_in_situ?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=latest_in_situ_obs">SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=latest_in_situ_obs">

• - <gml:boundedBy>- <gml:boundedBy>• - <gml:Box srsName="EPSG:4269">- <gml:Box srsName="EPSG:4269">• <gml:coordinates>-91.320000,22.030000 -72.230000,36.480000</gml:coordinates> <gml:coordinates>-91.320000,22.030000 -72.230000,36.480000</gml:coordinates> • </gml:Box></gml:Box>• </gml:boundedBy></gml:boundedBy>• • - <gml:featureMember>- <gml:featureMember>• - <latest_in_situ_obs>- <latest_in_situ_obs>• • - <gml:boundedBy>- <gml:boundedBy>• - <gml:Box srsName="EPSG:4269">- <gml:Box srsName="EPSG:4269">• <gml:coordinates>-79.710000,32.860000 -79.710000,32.860000</gml:coordinates> <gml:coordinates>-79.710000,32.860000 -79.710000,32.860000</gml:coordinates> • </gml:Box></gml:Box>• </gml:boundedBy></gml:boundedBy>• • - <gml:pointProperty>- <gml:pointProperty>• - <gml:Point srsName="EPSG:4269">- <gml:Point srsName="EPSG:4269">• <gml:coordinates>-79.710000,32.860000</gml:coordinates> <gml:coordinates>-79.710000,32.860000</gml:coordinates> • </gml:Point></gml:Point>• </gml:pointProperty></gml:pointProperty>

Page 25: XML and related technologies tutorial Developed using material at w3schools/xml

• <station_id>carocoops_CAP1_wls</station_id> <station_id>carocoops_CAP1_wls</station_id> • <report_time_stamp>2005-11-14 08:00:00</report_time_stamp> <report_time_stamp>2005-11-14 08:00:00</report_time_stamp> • <top_time_stamp>2005-11-14 09:54:00</top_time_stamp> <top_time_stamp>2005-11-14 09:54:00</top_time_stamp> • <air_pressure_time_stamp>2005-09-16 17:54:00</air_pressure_time_stamp> <air_pressure_time_stamp>2005-09-16 17:54:00</air_pressure_time_stamp> • <air_pressure_mb>1015.97 mb @ 3m</air_pressure_mb> <air_pressure_mb>1015.97 mb @ 3m</air_pressure_mb> • <air_pressure_mb_graph_and_data>http://nautilus.baruch.sc.edu/portal_rs/<air_pressure_mb_graph_and_data>http://nautilus.baruch.sc.edu/portal_rs/

query_details_air_pressure_in_situ.phtml?hour_range=24&station_id=carocoops_CAP1_wls&lon=-query_details_air_pressure_in_situ.phtml?hour_range=24&station_id=carocoops_CAP1_wls&lon=-79.71&lat=32.86&air_pressure_table=air_pressure_prod&archive_flag=&time_stamp=2005_09_16_17_54_79.71&lat=32.86&air_pressure_table=air_pressure_prod&archive_flag=&time_stamp=2005_09_16_17_54_00&pressure_units=MB</air_pressure_mb_graph_and_data> 00&pressure_units=MB</air_pressure_mb_graph_and_data>

• <air_pressure_inches_mercury>30.00 in Hg (0 deg C) @ 3m</air_pressure_inches_mercury> <air_pressure_inches_mercury>30.00 in Hg (0 deg C) @ 3m</air_pressure_inches_mercury> • <air_pressure_inches_mercury_graph_and_data>http://nautilus.baruch.sc.edu/portal_rs/<air_pressure_inches_mercury_graph_and_data>http://nautilus.baruch.sc.edu/portal_rs/

query_details_air_pressure_in_situ.phtml?hour_range=24&station_id=carocoops_CAP1_wls&lon=-query_details_air_pressure_in_situ.phtml?hour_range=24&station_id=carocoops_CAP1_wls&lon=-79.71&lat=32.86&air_pressure_table=air_pressure_prod&archive_flag=&time_stamp=2005_09_16_17_54_79.71&lat=32.86&air_pressure_table=air_pressure_prod&archive_flag=&time_stamp=2005_09_16_17_54_00&pressure_units=INCHES_MERCURY</air_pressure_inches_mercury_graph_and_data> 00&pressure_units=INCHES_MERCURY</air_pressure_inches_mercury_graph_and_data>

• <air_temperature_time_stamp>2005-09-17 03:54:00</air_temperature_time_stamp> <air_temperature_time_stamp>2005-09-17 03:54:00</air_temperature_time_stamp> • <air_temperature_celcius>26.98 deg C @ 3m</air_temperature_celcius> <air_temperature_celcius>26.98 deg C @ 3m</air_temperature_celcius> • <air_temperature_celcius_graph_and_data>http://nautilus.baruch.sc.edu/portal_rs/<air_temperature_celcius_graph_and_data>http://nautilus.baruch.sc.edu/portal_rs/

query_details_air_temperature.phtml?hour_range=24&station_id=carocoops_CAP1_wls&lon=-query_details_air_temperature.phtml?hour_range=24&station_id=carocoops_CAP1_wls&lon=-79.71&lat=32.86&air_temperature_table=air_temperature_prod&archive_flag=&time_stamp=2005_09_1779.71&lat=32.86&air_temperature_table=air_temperature_prod&archive_flag=&time_stamp=2005_09_17_03_54_00&degree_units=C</air_temperature_celcius_graph_and_data> _03_54_00&degree_units=C</air_temperature_celcius_graph_and_data>

• <air_temperature_fahrenheit>80.56 deg F @ 3m</air_temperature_fahrenheit> <air_temperature_fahrenheit>80.56 deg F @ 3m</air_temperature_fahrenheit> • <air_temperature_fahrenheit_graph_and_data>http://nautilus.baruch.sc.edu/portal_rs/<air_temperature_fahrenheit_graph_and_data>http://nautilus.baruch.sc.edu/portal_rs/

query_details_air_temperature.phtml?hour_range=24&station_id=carocoops_CAP1_wls&lon=-query_details_air_temperature.phtml?hour_range=24&station_id=carocoops_CAP1_wls&lon=-79.71&lat=32.86&air_temperature_table=air_temperature_prod&archive_flag=&time_stamp=2005_09_1779.71&lat=32.86&air_temperature_table=air_temperature_prod&archive_flag=&time_stamp=2005_09_17_03_54_00&degree_units=F</air_temperature_fahrenheit_graph_and_data> _03_54_00&degree_units=F</air_temperature_fahrenheit_graph_and_data>

• ......

• </latest_in_situ_obs></latest_in_situ_obs>• </gml:featureMember></gml:featureMember>

Page 26: XML and related technologies tutorial Developed using material at w3schools/xml

SEACOOS XML ServicesSEACOOS XML Services

http://nautilus.baruch.sc.edu/twiki_dmcc/bin/view/Main/http://nautilus.baruch.sc.edu/twiki_dmcc/bin/view/Main/CodeRepositorySeacoosXMLServicesCodeRepositorySeacoosXMLServices

Using an XML descriptor file to describe ASCII column Using an XML descriptor file to describe ASCII column oriented data for later processingoriented data for later processing

Web forms simplify the process of creating needed XMLWeb forms simplify the process of creating needed XML

Service currently exists for fixed point data which Service currently exists for fixed point data which converts ASCII to SEACOOS netCDFconverts ASCII to SEACOOS netCDF

Data scout currently converts netCDF to SQL for Data scout currently converts netCDF to SQL for relational database population, but future efforts relational database population, but future efforts may skip netCDF step entirelymay skip netCDF step entirely

Page 27: XML and related technologies tutorial Developed using material at w3schools/xml

• time,wind_speed,wind_from_direction,sea_surtime,wind_speed,wind_from_direction,sea_surface_temperatureface_temperature

• 2004-10-22 2004-10-22 14:00:00+00_SEP_5.0_SEP_120.0.0_SEP_12.014:00:00+00_SEP_5.0_SEP_120.0.0_SEP_12.0

• 2004-10-22 2004-10-22 15:00:00_SEP_6.0_SEP_125.0_SEP_13.015:00:00_SEP_6.0_SEP_125.0_SEP_13.0

• 2004-10-22 2004-10-22 16:00:00_SEP_7.0_SEP_130.0_SEP_14.016:00:00_SEP_7.0_SEP_130.0_SEP_14.0

• 2004-10-22 2004-10-22 17:00:00_SEP_8.0_SEP_135.0_SEP_15.017:00:00_SEP_8.0_SEP_135.0_SEP_15.0

Page 28: XML and related technologies tutorial Developed using material at w3schools/xml
Page 29: XML and related technologies tutorial Developed using material at w3schools/xml

• <global_attributes><global_attributes>

• <!-- repeatable element --><!-- repeatable element -->• <conventions>CF-1.0</conventions><conventions>CF-1.0</conventions>• <conventions>SEACOOS-NETCDF-2.0</conventions><conventions>SEACOOS-NETCDF-2.0</conventions>• <conventions>SEACOOS-XML-1.0</conventions><conventions>SEACOOS-XML-1.0</conventions>

• <!-- platform information --><!-- platform information -->

• <!-- format_category list<!-- format_category list• [fixed-point,fixed-profiler,fixed-map,moving-point-2D,moving-point-3D,moving-[fixed-point,fixed-profiler,fixed-map,moving-point-2D,moving-point-3D,moving-

profiler]profiler]• -->-->• <format_category>fixed-point</format_category><format_category>fixed-point</format_category>

• <contact_info>Jeremy Cothran ([email protected])</contact_info><contact_info>Jeremy Cothran ([email protected])</contact_info>

• <institution_desc>Baruch Institute, University of South Carolina at <institution_desc>Baruch Institute, University of South Carolina at Columbia</institution_desc>Columbia</institution_desc>

• <institution_url>http://carocoops.org</institution_url><institution_url>http://carocoops.org</institution_url>

• <institution_id>carocoops</institution_id><institution_id>carocoops</institution_id>• <platform_id>CAP2</platform_id><platform_id>CAP2</platform_id>• <package_id>buoy</package_id><package_id>buoy</package_id>

Page 30: XML and related technologies tutorial Developed using material at w3schools/xml

<!-- file information --> <!-- file information --> <data_url>http://trident.baruch.sc.edu/storm<data_url>http://trident.baruch.sc.edu/storm_surge_data/latest</data_url> _surge_data/latest</data_url> <filename_search></filename_search> <filename_search></filename_search> <file_row_start>2</file_row_start> <file_row_start>2</file_row_start> <file_row_comment></file_row_comment> <file_row_comment></file_row_comment> <file_field_separator>_SEP_</file_field_separ<file_field_separator>_SEP_</file_field_separator> ator> <file_field_missing_value></file_field_missing<file_field_missing_value></file_field_missing_value> <column_time></column_time> _value> <column_time></column_time> <measurement_time_zone></measurement_<measurement_time_zone></measurement_time_zone> time_zone>

Page 31: XML and related technologies tutorial Developed using material at w3schools/xml

<dependent_variables><dependent_variables>

<!-- repeatable element --><!-- repeatable element -->

<variable><variable>

<column_number>2</column_number> <column_number>2</column_number> <standard_name>wind_speed</standard_na<standard_name>wind_speed</standard_name> <units>m s-1</units>me> <units>m s-1</units>

<z>3.0</z><z>3.0</z>

</variable></variable>