scientific application using xml and web tools pacific marine environmental laboratory margaret...

35
Scientific Application Using XML and Web Tools Pacific Marine Environmental Laboratory Margaret Sullivan, Research Scientist, JISAO/UW, PMEL/FOCI

Upload: dominic-marsh

Post on 28-Dec-2015

221 views

Category:

Documents


1 download

TRANSCRIPT

Scientific Application Using

XML and Web Tools

Pacific Marine Environmental Laboratory

Margaret Sullivan, Research Scientist, JISAO/UW, PMEL/FOCI

Fisheries-Oceanography Coordinated

Investigations

Physical oceanography (PMEL) and fisheries

(NOAA/AFSC) interdisciplinary studies

North Pacific: Gulf of Alaska, Aleutian Islands, Bering Sea

XML ApplicationXML Application: 1

1 Overview of Mooring Work2 Web Requirements, Goals3 Explore Tools, Define

Solutions4 The Benefits5 The Bigger Picture6 Ending Information

Mooring Sites Map

Overview of Mooring Work

Mooring Work

Overview of Mooring Work

Overview of Mooring Work

Engineeri

ng drawing of a mooring

Overview of Mooring Work

Mooring Cartoon

A Year in Moorings(The first model of a larger, integrated

system)

• Design the year’s moorings and cruises based on ongoing research

• Create Excel tables for cruises/moorings

• Distribute spreadsheets to engineering

• Build moorings• Transport moorings to ship(s)• Deploy moorings

Overview of Mooring Work

Overview of Mooring Work

Mooring Plans

Summary Table in

Excel

Overview of Mooring Work

Tables for 3 Moorings in

Excel

Types of Data Needed

• Project and budget information • Geographic - name, latitude, longitude,

depth, current speed• Instruments - itemized list with names

and depths• Instrument - tally per type, mooring,

and cruise• Past mooring information and design

changes

Overview of Mooring Work

XML ApplicationXML Application: 2

1 Overview of Mooring Work2 Web Requirements, Goals3 Explore Tools, Define

Solutions4 The Benefits5 The Bigger Picture6 Ending Information

Basic Web Requirements

• Mooring planning information to web• Web tables visible to all interested

parties• Mooring information changes

controlled

Web Requirements, Goals

Enhanced Requirements

• System evolved from 1-person, Excel, paper, desktop

• Uniform information available to planners and engineers

• Data changes are accountable and dated

• Web display/information similar to Excel format

• Main summary table, links to individual mooring tables

• Data resource that is reusable and update-able

• Portable data subset on PDA for deploy/recovery

Web Requirements, Goals

XML ApplicationXML Application: 3

1 Overview of Mooring Work2 Web Requirements, Goals3 Explore Tools, Define

Solutions4 The Benefits5 The Bigger Picture6 Ending Information

Explore Tools, Define Solutions

Flow of Logic

Acronyms

CGI – Common Gateway Interface

XML - eXtensible Markup Language (*.xml)

XSD - XML Schema Definition (*.xsd)

XSL - eXtensible Stylesheet Language (*.xsl)

XSLT - eXtensible Stylesheet Language Transformations

Explore Tools, Define Solutions

Web Input and CGI

• Input– XForms, HTML (xhtml)– Perl forms– Javascript– Applet or servlet (Java)

• Common Gateway Interface Protocol– Perl– PHP– Java, Programming languages?….

Explore Tools, Define Solutions

XML Design Explore Tools, Define Solutions

<?xml version="1.0" encoding="UTF-8" ?> <?xml-stylesheet version="1.0"?> - <MoorList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="my_test4.xsd"> - <Mooring> <MoorName>03GP-32B</MoorName> <MoorType>Subsurface</MoorType> - <LocationInfo> <Lat/> <Lon/> <RegionName>Gore Point</RegionName> <RegionNameShort>GP</RegionNameShort> <Depth>256</Depth> <CurSpd>26</CurSpd> </LocationInfo> - <Project> <Year>2003</Year> <Month>February</Month> <Ship>Ron Brown</Ship>   <ProjName>Steller Sea Lion</ProjName> <ProjComment>SSL Year 3</ProjComment> <Budget>8R3U7360</Budget> </Project> <ReleaseType>Benthic</ReleaseType> - <MoorNotes> <PrevDeploy>03GP-32A in April 2003</PrevDeploy> <DesignChange>NONE</DesignChange> </MoorNotes> - <Instruments> + <Instr> + <Instr> + <Instr> </Instruments> </Mooring> + <Mooring> + <Mooring> </MoorList>

(more than one)

(more than one)

A Sample of Schema and Stylesheet

XML Schema Definition (*.xsd):<?xml version="1.0"?><xs:schema version="1.0“ xmlns:xs="http://www.w3.org/2001/10/XMLSchema"><xs:element name="MoorList"> <xs:complexType> <xs:sequence> <xs:element ref="Mooring“ maxOccurs="unbounded"/> </xs:sequence> </xs:complexType></xs:element>

XML Stylesheet (*.xsl):<?xml version='1.0' encoding=“UTF-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="/"> <html><head> <title>Mooring Table</title></head> <body bgcolor="#FFFFFF"> <xsl:for-each select="MoorList/Mooring"> <H1><center> <xsl:value-of select ="Project/Month"/>&#160; <xsl:value-of select="Project/Year"/>&#160;-&#160; </center></H1> <h3><xsl:value-of select="MoorName"/>&#160; <xsl:value-of select=" MoorType "/> </h3> </xsl:for-each></body></html>

Explore Tools, Define Solutions

XSLT Choices

• Xalan/Xerces (Java)• Perl: CGI, XSLT, LibXML,

LibXSLT• PHP• Javascript

Explore Tools, Define Solutions

Perl Mods for XML

• CGI.pm• Expat (C, foundation)• XML::Simple • XML::XSLT• XML::LibXML• XML::LibXSLT• XML::Parser

Explore Tools, Define Solutions

For Consideration

• Get vs Post• Why XML• DTD vs Schema• DOM and SAX• Extensibility• Portability

Explore Tools, Define Solutions

XML ApplicationXML Application: 4

1 Overview of Mooring Work2 Web Requirements, Goals3 Explore Tools, Define

Solutions4 The Benefits5 The Bigger Picture6 Ending Information

Web Site

The Benefits

Excel HTML/Web

The Benefits

Other•Security:

- input control, validation- regenerate content

•Access at sea to pertinent subset (PDA)•XML as multi-purpose resource:

The Benefits

XML ApplicationXML Application: 5

1 Overview of Mooring Work2 Web Requirements, Goals3 Explore Tools, Define

Solutions4 The Benefits5 The Bigger Picture6 Ending Information

The Bigger Picture

XML ApplicationXML Application: 6

1 Overview of Mooring Work2 Web Requirements, Goals3 Explore Tools, Define

Solutions4 The Benefits5 The Bigger Picture6 Ending Information

Technical References

Books:• Perl & XML, 2nd ed., E.T.Ray and J.McIntosh, O’Reilly.• XML for the World Wide Web, Visual Quickstart Guide, E.Castro,

Peachpit Press.• XSLT, Mastering XML Transformations, 2001 D.Tidwell, O’Reilly.• CGI Programming, 2nd ed., 2000, Guelich, Gundavaram & Birznieks

O’Reilly.• Perl Cookbook, 2nd ed., 2003, Christiansen & Torkington, O’Reilly.

Web Article:• XML DTDs vs XML Schema, Michael Jervis, Nov.26, 2002,

www.sitepoint.com/print (search on ‘Jervis’)

Web Sites:• CPAN Perl modules: http://www.cpan.org/modules/index.html• World Wide Web Consortium (W3C): http://www.w3.org/• W3C tutorial: http://www.w3schools.com/xml/default.asp• O’Reilly tutorials, books, e-learning: http://www.oreilly.com• Apache XML project: http://xml.apache.org/xalan-j/index.html

Ending Information

People

• FOCI– B.Parker,

C.Dewitt– P.Stabeno– C.Hadden– R.Reed, N.

Merati

• Engineering– H.V.Miller

Ending Information

Ending Information

Scientific Application Using XML and Web ToolsMargaret Sullivan, JISAO/UW,

PMEL/FOCI