XML - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

XML

Description:

Every time you start ArcCatalog, metadata is initially presented with the ... users to export GIS data in 'keyhole markup language' (KML) format for viewing ... – PowerPoint PPT presentation

Number of Views:35
Avg rating:3.0/5.0
Slides: 18
Provided by: maile7
Category:
Tags: xml | keyhole

less

Transcript and Presenter's Notes

Title: XML


1
XML
  • XML is about interoperability between different
    data/software environments
  • Discretion and representation of data
  • DTD (.dtd) describes XML elements data
    dictionary
  • XSL presentation and transformation

2
XML and Metadata
  • Every time you start ArcCatalog, metadata is
    initially presented with the default metadata
    stylesheet.
  • lt?xml version"1.0" encoding"ISO-8859-1" ?gt
  • - ltmetadatagt
  • - ltidinfogt
  • - ltcitationgt
  • - ltciteinfogt
  •   ltorigingtNational Oceanic and Atmospheric
    Administration (NOAA) Coastal Services Center
    (CSC)lt/origingt
  •   ltpubdategt19950101lt/pubdategt
  •   lttitlegtMINERALS MANAGEMENT SERVICE ACTIVE LEASE
    SITESlt/titlegt
  •   ltgeoformgtSHAPElt/geoformgt
  •   ltonlinkgthttp//www.csc.noaa.govlt/onlinkgt
  • - ltpubinfogt
  •   ltpublishgtNational Oceanic and Atmospheric
    Administration (NOAA)lt/publishgt
  •   lt/pubinfogt
  •   ltftname Sync"TRUE"gtactlealt/ftnamegt
  •   lt/citeinfogt
  •   lt/citationgt
  • - ltdescriptgt

3
XML for Metadata
  • Metadata is stored as extensible markup language
    (XML)
  • data in a file with the data or in a geodatabase.
    The Catalog
  • uses XSL Transformations (XSLT) stylesheets to
    transform
  • the XML data into a hypertext markup language
    (HTML)
  • page. You can change the metadatas appearance by
  • changing the current stylesheet using the
    dropdown list on
  • the Metadata toolbar.
  • (source ESRI Using ArcCatalog)

4
XML for Metadata
  • XML data is embedded within tags that add
    meaning. For
  • example, ltpricegt24lt/pricegt declares 24 to be a
    price. In XML
  • terms this price is referred to as an element.
    Other elements might
  • be product names, quantities, or totals. While a
    person can look
  • at the XML and determine that 24 is a price,
    whats more important
  • is that software can extract price elements from
    the file this
  • isnt possible with the HTML file, where there is
    nothing to
  • distinguish 24 from C.
  • (source ESRI Using ArcCatalog)

5
Referencing metaeditor.dll
6
Creating and editing metadata
  • See the webhelp article http//webhelp.esri.com/ar
    cgisdesktop/9.1/index.cfm?TopicNameCreating20and
    20updating20metadata for how to create and
    edit metadata

7
Metadata
  • Data about the data
  • i.e. fields, where the data came from, format,
    utilization
  • Stored in xml
  • Metadata created with ArcCatalog is stored as XML
    data, either in a file alongside the item, or
    within its geodatabase. In a geodatabase,
    metadata is stored in the GDB UserMetadata table
    as a BLOB of XML data (webhelp.esri.com).

8
XML uses XLST
  • XML data can be displayed in a Web browser using
    eXtensible Style Language Transformations (XSLT)
    stylesheets that transform the XML data into an
    HTML page.

9
Programmatically create XML for you Metadata
(Article ID23693)
  • 'Get the selected object and make sure it's a
    folder Dim pGxApp As IGxApplication Dim pGxObj
    As IGxObject Set pGxApp Application Set
    pGxObj pGxApp.SelectedObject If Not (TypeOf
    pGxObj Is IGxFolder) Then Exit Sub Dim sName As
    String Dim lCnt As Long sName
    "New_XML_Document" lCnt 1

10
'Count the number of objects in the folder whose
names begin 'with "New_XML_Document" Dim pGxCnt
As IGxObjectContainer Set pGxCnt pGxObj If
pGxCnt.HasChildren Then Dim pGxChldEn As
IEnumGxObject Dim pGxChld As IGxObject Set
pGxChldEn pGxCnt.Children On Error Resume Next
Set pGxChld pGxChldEn.Next Do While Not
pGxChld Is Nothing If Left(pGxChld.name, 16)
sName Then lCnt lCnt 1 Set pGxChld
pGxChldEn.Next Loop End If
11
If lCnt gt 1 Then sName sName "(" lCnt ")"
'Create a new GxMetadata object and give it a
file name Dim pGxFile As IGxFile Set pGxFile
New GxMetadata pGxFile.path pGxObj.FullName
"\" sName ".xml" 'Generate metadata for the
new GxObject Dim pMD As IMetadata Dim pXPS As
IXmlPropertySet Set pMD pGxFile Set pXPS
New XmlPropertySet pMD.Metadata pXPS
'Refresh the folder's contents pGxObj.Refresh
12
IMetadata interface
  • implemented by the GxMetadata object and all
    other objects that support metadata (the bulk of
    GxObject types). Use this interface when you want
    to access the set of metadata associated with an
    object or you want to create new metadata for the
    object.

13
Export to KML
  • an extension developed for ArcGIS 9.x by the City
    of Portland, Bureau of Planning.
  • The extension allows ArcGIS users to export GIS
    data in keyhole markup language (KML) format
    for viewing in the free Google Earth data viewer.
  • I heard about it through SHRUG list

14
(No Transcript)
15
(No Transcript)
16
KML is XML technology
  • lt?xml version"1.0" encoding"UTF-8"?gt
  • ltkml xmlns"http//earth.google.com/kml/2.0"gt
  • ltDocumentgt
  • ltnamegtFraudByJurisJoinedlt/namegt
  • ltopengt1lt/opengt
  • ltdescriptiongtlt!CDATAExported from
    FraudByJurisJoined on 4/10/2007gtlt/descriptiongt
  • ltStyle id"1"gt
  • ltLineStylegt
  • ltcolorgtFF6E6E6Elt/colorgt
  • ltwidthgt0.4lt/widthgt
  • lt/LineStylegt
  • ltPolyStylegt
  • ltoutlinegt1lt/outlinegt
  • ltfillgt1lt/fillgt
  • ltcolorgtFF80FFFFlt/colorgt
  • lt/PolyStylegt
  • lt/Stylegt
  • ltStyle id"1_LABELS"gt

17
Class Project Deliverables
  • Text (in .txt or .doc or .rtf file) of your code
    source
  • Doc (in .doc) of your directions/manual/report
    describing what you have automated customized
    (include screenshots - use print key). If you
    were selling this product this would be the
    documentation included
  • What I dont want .mxd or .mxt files
  • Due by Week 16 (4/25/07) 5PM ? email it to me
Write a Comment
User Comments (0)
About PowerShow.com