I am new in Java programming. I have a question about parsing data from an xml file. That can be maybe using string functions or some other functions.
here is the xml file I have:
<?xml version="1.0" encoding="ISO-8859-1"?>
<metadata>
<idinfo>
<citation>
<citeinfo>
<origin>National Park Service Geologic Resources Inventory (GRI) program.</origin>
<pubdate>Unpublished Material</pubdate>
<title>Geologic Units and Contacts of Natural Bridges National Monument and Vicinity, Utah (NPS, GRI, NABR, NABRGLG)</title>
<edition>1st</edition>
<geoform>vector digital data</geoform>
<lworkcit>
<citeinfo>
<origin>National Park Service Geologic Resources Inventory (GRI) program.</origin>
<pubdate>20010301</pubdate>
<title>Geologic Map of Natural Bridges National Monument and Vicinity, Utah</title>
</citeinfo>
</lworkcit>
</citeinfo>
</citation>
<descript>
<abstract>The Geologic Units and Contacts of Natural Bridges National Monument and Vicinity, Utah data (NABRGLG) consists of area (polygon) geologic units and the contacts/map boundary that defines those areas (polygons). The data were completed as a component of the Geologic Resources Inventory (GRI), a co-operative program between the Natural Resources Information Division (NRID) Inventory and Monitoring Program (IM) and the Geologic Resources Division (GRD) of the National Park Service (NPS). The spatial data (coverage/theme) was produced from an .E00 coverage with area geologic units and contact arcs. The 'new' coverage/theme (NABRGLG/NABRGLGA) was attributed as per the NPS GIS-Geology Data Model. An indexed ArcInfo .E00 (export) coverage file and an ArcView 3.2 .SHP theme were then also created. The coverage/theme is within the area of interest of Natural Bridges National Monument. The coverage/theme is in NAD83, UTM Zone 12N.</abstract>
<purpose>Data intended to assist NPS personnel in the protection and management of Natural Bridges National Monument.</purpose>
<supplinf>The Geologic Units and Contacts of Natural Bridges National Monument and Vicinity, Utah coverage/theme (NABRGLG/NABRGLGA) is a component of the Geologic Map of Natural Bridges National Monument and Vicinity, Utah. Other coverages/themes that comprise the Geologic Map of Natural Bridges National Monument and Vicinity, Utah include: NABRATD (geologic attitude observation points), NABRSEC (geologic cross section lines) and NABRUPF (unique geologic point features). Two accessory data tables, NABRGLG1 (accessory geologic unit data) and NABRMAP (source map information), are also considered map components.</supplinf>
</descript>
<timeperd>
<timeinfo>
<sngdate>
<caldate>20010301</caldate>
<time>Unknown</time>
</sngdate>
</timeinfo>
<current>ground condition</current>
</timeperd>
<status>
<progress>Complete</progress>
<update>None planned</update>
</status>
<keywords>
<theme>
<themekt>none</themekt>
<themekey>Natural Bridges National Monument</themekey>
<themekey>Utah</themekey>
<themekey>geology</themekey>
<themekey>geologic units</themekey>
<themekey>geologic contacts</themekey>
<themekey>GLG</themekey>
<themekey>NABRGLG</themekey>
<themekey>National Park Service</themekey>
<themekey>NPS</themekey>
<themekey>Geologic Resources Inventory</themekey>
<themekey>GRI</themekey>
</theme>
<place>
<placekt>none</placekt>
<placekey>Natural Bridges National Monument</placekey>
<placekey>Utah</placekey>
<placekey>United States</placekey>
<placekey>US</placekey>
<placekey>USA</placekey>
<placekey>North America</placekey>
<placekey>NABR</placekey>
</place>
</keywords>
<accconst>None</accconst>
<useconst>Not for use at scale greater than 1:24,000.</useconst>
<ptcontac>
<cntinfo>
<cntperp>
<cntper>Stephanie O'Meara</cntper>
<cntorg>Colorado State University</cntorg>
</cntperp>
<cntpos>Research Associate, Geologist/GIS Specialist</cntpos>
<cntaddr>
<addrtype>mailing and physical address</addrtype>
<address>1201 Oak Ridge Drive, Suite 200</address>
<city>Fort Collins</city>
<state>Colorado</state>
<postal>80525</postal>
<country>USA</country>
</cntaddr>
<cntvoice>(970) 225-3584</cntvoice>
<cntfax>(970) 225-3585</cntfax>
<cntemail>Stephanie_O'Meara@nps.gov</cntemail>
<hours>9:00 a.m. to 5:00 p.m. (MST), Monday - Friday</hours>
</cntinfo>
</ptcontac>
<datacred>Jaqueline E. Huntoon (Michigan Technological University).</datacred>
<native>Windows NT Version 4.0 (Build 1381) Service Pack 6; ESRI ArcInfo 8.1.0.415</native>
</idinfo>
</metadata>
I would like to take the data out between the tags. Is there anyway i can do it with string functions. Can someone help me. thanks.
here is the xml file I have:
<?xml version="1.0" encoding="ISO-8859-1"?>
<metadata>
<idinfo>
<citation>
<citeinfo>
<origin>National Park Service Geologic Resources Inventory (GRI) program.</origin>
<pubdate>Unpublished Material</pubdate>
<title>Geologic Units and Contacts of Natural Bridges National Monument and Vicinity, Utah (NPS, GRI, NABR, NABRGLG)</title>
<edition>1st</edition>
<geoform>vector digital data</geoform>
<lworkcit>
<citeinfo>
<origin>National Park Service Geologic Resources Inventory (GRI) program.</origin>
<pubdate>20010301</pubdate>
<title>Geologic Map of Natural Bridges National Monument and Vicinity, Utah</title>
</citeinfo>
</lworkcit>
</citeinfo>
</citation>
<descript>
<abstract>The Geologic Units and Contacts of Natural Bridges National Monument and Vicinity, Utah data (NABRGLG) consists of area (polygon) geologic units and the contacts/map boundary that defines those areas (polygons). The data were completed as a component of the Geologic Resources Inventory (GRI), a co-operative program between the Natural Resources Information Division (NRID) Inventory and Monitoring Program (IM) and the Geologic Resources Division (GRD) of the National Park Service (NPS). The spatial data (coverage/theme) was produced from an .E00 coverage with area geologic units and contact arcs. The 'new' coverage/theme (NABRGLG/NABRGLGA) was attributed as per the NPS GIS-Geology Data Model. An indexed ArcInfo .E00 (export) coverage file and an ArcView 3.2 .SHP theme were then also created. The coverage/theme is within the area of interest of Natural Bridges National Monument. The coverage/theme is in NAD83, UTM Zone 12N.</abstract>
<purpose>Data intended to assist NPS personnel in the protection and management of Natural Bridges National Monument.</purpose>
<supplinf>The Geologic Units and Contacts of Natural Bridges National Monument and Vicinity, Utah coverage/theme (NABRGLG/NABRGLGA) is a component of the Geologic Map of Natural Bridges National Monument and Vicinity, Utah. Other coverages/themes that comprise the Geologic Map of Natural Bridges National Monument and Vicinity, Utah include: NABRATD (geologic attitude observation points), NABRSEC (geologic cross section lines) and NABRUPF (unique geologic point features). Two accessory data tables, NABRGLG1 (accessory geologic unit data) and NABRMAP (source map information), are also considered map components.</supplinf>
</descript>
<timeperd>
<timeinfo>
<sngdate>
<caldate>20010301</caldate>
<time>Unknown</time>
</sngdate>
</timeinfo>
<current>ground condition</current>
</timeperd>
<status>
<progress>Complete</progress>
<update>None planned</update>
</status>
<keywords>
<theme>
<themekt>none</themekt>
<themekey>Natural Bridges National Monument</themekey>
<themekey>Utah</themekey>
<themekey>geology</themekey>
<themekey>geologic units</themekey>
<themekey>geologic contacts</themekey>
<themekey>GLG</themekey>
<themekey>NABRGLG</themekey>
<themekey>National Park Service</themekey>
<themekey>NPS</themekey>
<themekey>Geologic Resources Inventory</themekey>
<themekey>GRI</themekey>
</theme>
<place>
<placekt>none</placekt>
<placekey>Natural Bridges National Monument</placekey>
<placekey>Utah</placekey>
<placekey>United States</placekey>
<placekey>US</placekey>
<placekey>USA</placekey>
<placekey>North America</placekey>
<placekey>NABR</placekey>
</place>
</keywords>
<accconst>None</accconst>
<useconst>Not for use at scale greater than 1:24,000.</useconst>
<ptcontac>
<cntinfo>
<cntperp>
<cntper>Stephanie O'Meara</cntper>
<cntorg>Colorado State University</cntorg>
</cntperp>
<cntpos>Research Associate, Geologist/GIS Specialist</cntpos>
<cntaddr>
<addrtype>mailing and physical address</addrtype>
<address>1201 Oak Ridge Drive, Suite 200</address>
<city>Fort Collins</city>
<state>Colorado</state>
<postal>80525</postal>
<country>USA</country>
</cntaddr>
<cntvoice>(970) 225-3584</cntvoice>
<cntfax>(970) 225-3585</cntfax>
<cntemail>Stephanie_O'Meara@nps.gov</cntemail>
<hours>9:00 a.m. to 5:00 p.m. (MST), Monday - Friday</hours>
</cntinfo>
</ptcontac>
<datacred>Jaqueline E. Huntoon (Michigan Technological University).</datacred>
<native>Windows NT Version 4.0 (Build 1381) Service Pack 6; ESRI ArcInfo 8.1.0.415</native>
</idinfo>
</metadata>
I would like to take the data out between the tags. Is there anyway i can do it with string functions. Can someone help me. thanks.