Title: XML
1XML
- 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
2XML 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
3XML 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)
4XML 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)
5Referencing metaeditor.dll
6Creating 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
7Metadata
- 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).
8XML 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.
9Programmatically 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
11If 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
12IMetadata 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.
13Export 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)
16KML 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
17Class 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