Here's what I've come up with for the DTD. I turned it upside down so it starts with the smaller elements and
works it's way bigger. It turned out easier that way due to the use of <!ENTITYs.
I've tried to comment a lot to: remember what the heck I was thinking (or not thinking) and to make kind of self
document the structure.
(Opening the floodgates) Comments?
Richard
======================== begin CaveXML.DTD ========================
<?xml encoding="UTF-8"?>
<!-- This format starts with the small and gets bigger -->
<!-- general entities for use later -->
<!ENTITY % BaseAngleUnits "Degrees | DMS | Mills | Grad">
<!ENTITY % AndBearing "| Bearing">
<!ENTITY % AndPercent "| Percent">
<!ENTITY % AzimuthUnits "%BaseAngleUnits;%AndBearing;">
<!ENTITY % InclinationUnits "%BaseAngleUnits;%AndPercent;">
<!ENTITY % LengthUnits "Feet | FeetInch | Meter | CM">
<!-- Exclusion element allows small or large sections of data to
be removed from processing or drawing. To be included in this
version are:
Length : Do not include length in totals
Plot : do not plot
Closure : do not consider for closure purposes.
It may be helpful to add an "All" to cover all three cases or
that logic could be put into a program -->
<!-- General purpose Elements -->
<!ELEMENT Name EMPTY>
<!ATTLIST Name
xml:lang NMTOKEN #IMPLIED
Value CDATA #IMPLIED>
<!ELEMENT Comment (#PCDATA)>
<!ATTLIST Comment
xml:lang NMTOKEN #IMPLIED>
<!ELEMENT Exclusions EMPTY>
<!ATTLIST Exclusions
Length (Yes | No) "No"
Plot (Yes | No) "No"
Closure (Yes | No) "No">
<!-- Coordinate information -->
<!-- Individual coordinate elements -->
<!ELEMENT Northing EMPTY>
<!ATTLIST Northing
Value CDATA #IMPLIED
Units (%LengthUnits;) #IMPLIED>
<!ELEMENT Easting EMPTY>
<!ATTLIST Easting
Value CDATA #IMPLIED
Units (%LengthUnits;) #IMPLIED>
<!ELEMENT Elevation EMPTY>
<!ATTLIST Elevation
Value CDATA #IMPLIED
Units (%LengthUnits;) #IMPLIED>
<!ELEMENT Latitude EMPTY>
<!ATTLIST Latitude
Value CDATA #IMPLIED
Units (%BaseAngleUnits;) #IMPLIED>
<!ELEMENT Longitude EMPTY>
<!ATTLIST Longitude
Value CDATA #IMPLIED
Units (%BaseAngleUnits;) #IMPLIED>
<!ELEMENT Zone EMPTY>
<!ATTLIST Zone
Value CDATA #IMPLIED>
<!-- Coordinate groups -->
<!ELEMENT RectangularBase (Northing, Easting, Elevation)>
<!ELEMENT Coord-Rectangular (RectangularBase)>
<!ELEMENT Coord-Spherical (Latitude, Longitude, Elevation)>
<!ELEMENT Coord-UTM (RectangularBase, Zone)>
<!-- Raw survey elements -->
<!-- Data items -->
<!-- Depending on the outcome of the shot and station discussion, this may be necessary
to allow for back shots. From and To are not actually necessary since the same
could be done by having a station, a shot direction, and another station. -->
<!ELEMENT Direction EMPTY>
<!ATTLIST Direction
Value (Forward | Backwards) "Forward">
<!-- The azimuth can be designated a front or back sight with a value. If necessary, default
survey units can be overridden -->
<!ELEMENT Azimuth EMPTY>
<!ATTLIST Azimuth
Direction (Front | Back) "Front"
Value CDATA #REQUIRED
Units (%AzimuthUnits;) #IMPLIED>
<!-- The inclination can be designated a front or back sight with a value. If necessary, default
survey units can be overridden -->
<!ELEMENT Inclination EMPTY>
<!ATTLIST Inclination
Direction (Front | Back) "Front"
Value CDATA #REQUIRED
Units (%InclinationUnits;) #IMPLIED>
<!-- The depth (for u/w surveys) is attached to a station (either defined or referenced.
The default survey units can be overridden. This was attached to a station because
it really isn't vector or relative information; it is absolute information. Of course,
if the variation of water levels is accounted, it would produce something similar to
a level survey. -->
<!ELEMENT Depth EMPTY>
<!ATTLIST Depth
Value CDATA #REQUIRED
Units (%LengthUnits;) #IMPLIED>
<!-- The drop element allows for level surveys - which produce elevation deltas -
to fit into the survey. A better name for this might be VerticalDistance or
VerticalOffset. Drop sounds kind of weird. -->
<!ELEMENT Drop EMPTY>
<!ATTLIST Drop
Position (From | To) "From"
Value CDATA #REQUIRED
Units (%LengthUnits;) #IMPLIED>
<!-- The distance has a value. If necessary, default survey units can be overridden -->
<!ELEMENT Distance EMPTY>
<!ATTLIST Distance
Value CDATA #REQUIRED
Units (%LengthUnits;) #IMPLIED>
<!-- The height of the instrument above or below the station -->
<!ELEMENT InstrumentHeight EMPTY>
<!ATTLIST InstrumentHeight
Value CDATA #REQUIRED
Units (%LengthUnits;) #IMPLIED>
<!-- The height of the target above or below the station -->
<!ELEMENT TargetHeight EMPTY>
<!ATTLIST TargetHeight
Value CDATA #REQUIRED
Units (%LengthUnits;) #IMPLIED>
<!-- Wall/Passage dimension definition -->
<!ELEMENT Walls (Left, Right, (Up | Ceiling), (Down | Floor))>
<!ELEMENT Left EMPTY>
<!ATTLIST Left
Value CDATA #IMPLIED
Units (%LengthUnits;) #IMPLIED>
<!ELEMENT Right EMPTY>
<!ATTLIST Right
Value CDATA #IMPLIED
Units (%LengthUnits;) #IMPLIED>
<!ELEMENT Up EMPTY>
<!ATTLIST Up
Value CDATA #IMPLIED
Units (%LengthUnits;) #IMPLIED>
<!ELEMENT Ceiling EMPTY>
<!ATTLIST Ceiling
Value CDATA #IMPLIED
Units (%LengthUnits;) #IMPLIED>
<!ELEMENT Down EMPTY>
<!ATTLIST Down
Value CDATA #IMPLIED
Units (%LengthUnits;) #IMPLIED>
<!ELEMENT Floor EMPTY>
<!ATTLIST Floor
Value CDATA #IMPLIED
Units (%LengthUnits;) #IMPLIED>
<!-- Station definitions -->
<!-- A station can be a declaration/new station or a reference to a previously declared station -->
<!-- The declaration consists of the given name (ie. "A1" or "1") and the identifier -->
<!ELEMENT StationDeclaration (Coord-Rectangular | Depth)?>
<!ATTLIST StationDeclaration
xml:lang NMTOKEN #IMPLIED
Name CDATA #REQUIRED
GUID ID #REQUIRED>
<!-- The reference consists of the given name (ie. "A1" or "1") and an identifier reference.
This allows the same station (ID) to have name names. Similar to Survex's *equate or
Tunnel's *export -->
<!ELEMENT StationReference (Depth?)>
<!ATTLIST StationReference
xml:lang NMTOKEN #IMPLIED
Name CDATA #IMPLIED
GUID IDREF #REQUIRED>
<!ENTITY % Station "(StationDeclaration | StationReference)">
<!-- Shot definitions -->
<!-- Maybe a basic shot is a distance, one or more azimuths, one or more inclinations,
an optional instrument height and an optional target height, and optional exclusions.
That would look something like this -->
<!ENTITY % BaseShot1 "Azimuth+, (Inclination+ | Drop), InstrumentHeight?, TargetHeight?, Exclusions?">
<!ENTITY % BaseShot2 "Distance, %BaseShot1;">
<!ENTITY % Leg "%Station;, Direction?, %Station;">
<!-- Starting simple. A shot is an azimuth, an inclination or depth, and a distance -->
<!ELEMENT BasicShot (%Leg;, %BaseShot2;, Walls*)>
<!-- Triangulation -->
<!ENTITY % TriangulationLeg "%Leg;, %BaseShot1;, Walls?">
<!ELEMENT Triangulation (%TriangulationLeg;, (%TriangulationLeg;)+)>
<!ENTITY % Shot "(BasicShot | Triangulation)">
<!-- Survey data is a combination of shots, stations, and comments. Order is
determined when data is entered -->
<!ELEMENT Data (%Station; | %Shot; | Comment)*>
<!-- Survey header information -->
<!-- To be replaced by the ISO data element -->
<!ELEMENT Date EMPTY>
<!ATTLIST Date
Year CDATA #IMPLIED
Month CDATA #IMPLIED
Day CDATA #IMPLIED>
<!-- The magnetic declination for this date. If included, the value must be entered.
Is a declination of "11.5E" considered a Bearing? (since there is an implied "N" reference) -->
<!ELEMENT Declination EMPTY>
<!ATTLIST Declination
Value CDATA #REQUIRED
Accuracy CDATA #IMPLIED
Units (%AzimuthUnits;) #IMPLIED>
<!-- a rough cut at the roles -->
<!ELEMENT Role EMPTY>
<!ATTLIST Role
Job
(CDATA|Book|Sketch|Tape|FrontTape|RearTape|Instrument|FrontSight|BackSight|Inventory|Other)
#IMPLIED>
<!-- A person has a name and one or more roles -->
<!ELEMENT Person (Name, Role*)>
<!-- The people that worked on this survey. If a Personnel element is present, there must
be one or more Persons defined -->
<!ELEMENT Personnel (Person+)>
<!ELEMENT Instrument EMPTY>
<!ATTLIST Instrument
Kind (Compass|Tape|Inclinometer|Other) #REQUIRED
Position (Back|Front) #IMPLIED
Correction CDATA #IMPLIED
StandardDev CDATA #IMPLIED
Variance CDATA #IMPLIED
StandardErr CDATA #IMPLIED
Units (%LengthUnits;|%BaseAngleUnits;|Bearing|Percent) #IMPLIED
SerialNumber CDATA #IMPLIED
Owner CDATA #IMPLIED>
<!-- The instruments used in the survey. If the Equipment element is present, there
must be one or more instruments defined -->
<!ELEMENT Equipment (Instrument+)>
<!-- The format laid out in the book where one line format contains all the data on one
line and a two line format splits out the station and shot data on separate lines.
This is to record the original format in case it might be reproduced in the future -->
<!ELEMENT BookFormat EMPTY>
<!ATTLIST BookFormat
Style (OneLineFormat | TwoLineFormat) #IMPLIED>
<!-- Allows for other taping methods, especially support for Brunton use or a precision survey -->
<!ELEMENT TapeMethod EMPTY>
<!ATTLIST TapeMethod
Method (StationToStation | InstrumentToTarget | InstrumentToStation | StationToTarget)
"StationToStation">
<!-- The BackSightMethod states if the true readings were used of if they
were 'corrected' to match front sight readings -->
<!ELEMENT BackSightMethod EMPTY>
<!ATTLIST BackSightMethod
Corrected (Yes|No) "No">
<!-- Define how the passage dimensions are measured. -->
<!ELEMENT WallFormat EMPTY>
<!ATTLIST WallFormat
Location (From | To) #IMPLIED
Reference (Caver | Station) "Station"
Direction (PerpToNext | PerpToLast | Average) "PerpToNext">
<!-- Order Items with Units. Most are #IMPLIED since no one unit can be considered 'standard' -->
<!ELEMENT StationItem EMPTY>
<!ATTLIST StationItem
Units CDATA #FIXED "NULL"
Location (From | To) #IMPLIED>
<!ELEMENT DirectionItem EMPTY>
<!ATTLIST DirectionItem
Units CDATA #FIXED "NULL">
<!ELEMENT DistanceItem EMPTY>
<!ATTLIST DistanceItem
Units (%LengthUnits;) #IMPLIED>
<!ELEMENT AzimuthItem EMPTY>
<!ATTLIST AzimuthItem
Units (%AzimuthUnits;) #IMPLIED
Direction (Front | Back) "Front">
<!ELEMENT InclinationItem EMPTY>
<!ATTLIST InclinationItem
Units (%InclinationUnits;) #IMPLIED
Direction (Front | Back) "Front">
<!ELEMENT DropItem EMPTY>
<!ATTLIST DropItem
Units (%LengthUnits;) #IMPLIED
Direction (Front | Back) "Front">
<!ELEMENT InstrumentHeightItem EMPTY>
<!ATTLIST InstrumentHeightItem
Units (%LengthUnits;) #IMPLIED>
<!ELEMENT TargetHeightItem EMPTY>
<!ATTLIST TargetHeightItem
Units (%LengthUnits;) #IMPLIED>
<!-- It is also possible to have a generic element such as
<!ELEMENT DimItem EMPTY>
<!ATTLIST DimItem
Direction (Left | Right | Up | Down | Ceiling | Floor) #IMPLIED
Units (%LengthUnits;) #IMPLIED>
but the nesting is getting a little deep. The same would
hold true at the station (under Walls) -->
<!ELEMENT LeftItem EMPTY>
<!ATTLIST LeftItem
Units (%LengthUnits;) #IMPLIED>
<!ELEMENT RightItem EMPTY>
<!ATTLIST RightItem
Units (%LengthUnits;) #IMPLIED>
<!ELEMENT UpItem EMPTY>
<!ATTLIST UpItem
Units (%LengthUnits;) #IMPLIED>
<!ELEMENT CeilingItem EMPTY>
<!ATTLIST CeilingItem
Units (%LengthUnits;) #IMPLIED>
<!ELEMENT DownItem EMPTY>
<!ATTLIST DownItem
Units (%LengthUnits;) #IMPLIED>
<!ELEMENT FloorItem EMPTY>
<!ATTLIST FloorItem
Units (%LengthUnits;) #IMPLIED>
<!-- A format has a list of items in the order they appear in the survey book -->
<!-- In order to get units as part of the order, each type of measurement has to be split into
a separate element. The Units are then attached as attributes -->
<!ELEMENT OrderFormat (StationItem | DirectionItem |
DistanceItem | AzimuthItem | DropItem |
InstrumentHeightItem | TargetHeightItem |
LeftItem | RightItem | UpItem | CeilingItem | DownItem | FloorItem)+>
<!-- The elements of the survey header -->
<!-- Note: The Header Element may be removed in the future. -->
<!ELEMENT Header (Date, (Declination | Personnel | Equipment | OrderFormat | Comment | BookFormat |
TapeMethod | BackSightMethod | WallFormat)*)>
<!-- The raw survey data. A survey has a header and the data (shots/stations) -->
<!ELEMENT Survey (Name, Header, Data, Exclusions?)>
<!-- This is the section were raw survey data is held. If other information is necessary,
it can be added via another section (ie. Inventories, Pictures, etc). -->
<!ELEMENT Surveys (Survey+)>
<!-- The location of the Entance in one of these coordinate systems.
The type may not be needed but is included to make reading a little easier -->
<!ELEMENT Location (Coord-UTM | Coord-Rectangular | Coord-Spherical)>
<!ATTLIST Location
Type (Rectangular | Spherical | UTM) #IMPLIED>
<!-- This is the entrance station used for tying the cave to coordinate data -->
<!-- Reference is a station Reference Element. -->
<!ELEMENT Entrance (Reference, Location)>
<!-- A Cave has a Name, one or more entrances and Surveys -->
<!ELEMENT Cave (Name, Entrance*, Surveys)>
<!-- A System has a Name and is made up of one or more Caves -->
<!ELEMENT System (Name, Cave+)>
<!-- A file can contain a survey with many caves or a single cave -->
<!-- Version will hold the CaveXML release version this file used.
Source will hold information from a data conversion. Some values
could be: SMAPS, CMAP, Karst, COMPASS, OnStation, Survex. -->
<!ELEMENT CaveXML (System | Cave)>
<!ATTLIST CaveXML
Version CDATA #FIXED "0.01"
xmlns CDATA #FIXED "http://www.CaveXML.org"
Source CDATA #IMPLIED>
========================= end CaveXML.DTD =========================
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
This archive was generated by hypermail 2b30 : Mon Apr 02 2001 - 18:00:01 CEST