What is XML?
The eXtensible Markup Language (XML) has been defined by the World Wide Web Consortium (W3C) in 1998.
An XML Schema is used to define the building blocks allowed in an XML document. The XML Schema specifies the data structure and defines all data (elements and element attributes) that can appear in an XML document conforming to this schema.
For more detailed information on XML see www.w3schools.com
What is a Style Sheet?
A Style Sheet is a file that complies with the eXtensible Stylesheet Language (XSL). It is a language that uses templates and pattern matching to:
- translate XML into HTML, text etc.;
- filter and sort XML data; and
- format XML data based on the data value, like displaying negative numbers in red.
For more detailed information on XSL see www.w3schools.com
What is a Helper File?
A Helper file is just another style sheet that is used by other style sheets. Helper files do nothing directly with the data base and cannot be used on their own to process XML files.
LISCAD specific Helper files have the extension XSLT to separate them from normal LISCAD style sheets.
Typically a helper file is used to perform a common function that may need to be repeated within a style sheet or used by several style sheets. E.g. all directions in a LISCAD XML file are in radians, a helper file could be used to convert radian measure into DDD?MM'SS" format for presentation in a report.
Common Helper files are distributed with LISCAD and new ones will continue to be developed. Style sheet authors can also write their own Helper files.
What is LandXML?
LandXML is an XML Schema that facilitates the exchange of data created during the Land Planning, Civil Engineering and Land Survey process.
It is an XML data definition that is being established for the Land Management industry.
It is expected that by common use it will become a standard for Land Management related data.
For more detailed information on LandXML see http://www.landxml.org
What are the advantages of XML?
- Users or independent developers will be able to write style sheets to create their own particular data conversion or reports.
- XML files can be converted into HTML files which give access to a wide range of formatting and presentation options, allowing anyone that has a web browser installed to view them.
- Style sheet development is completely independent of the LISCAD code development.
- There will be no need to wait until the next version of LISCAD is released before a new data conversion or report can be distributed and used by customers. Access to new reports and Data Conversion is as easy as copying a new style sheet into your User folder.
- LandXML is already becoming a standard for transferring land related data between applications.
- Users can exchange style sheets with each other to produce the same data conversions or reports.
- The complete LISCAD data base can be exported as an XML file. This file can be used as a backup, or read by other applications that support the LISCAD data base schema. In the future this will give backward reading capability into earlier versions of LISCAD that support XML.
What is a LISCAD XML Schema?
An XML schema is an .XSD file which defines the data for a particular XML file.
LISCAD has its own XML Schemas defining data for its data base, traverse, horizontal and vertical least squares adjustments, least squares transformations and code tables.
The data definitions for current version of the LISCAD supported XML files are:
- LISCADXML-SEEDB-2.0.XSD - S.E.E. Data Base Schema
- LISCADXML-SEEDE-2.0.XSD - S.E.E. Directive Element Schema
- LISCADXML-ADJHZ-1.0.XSD - S.E.E. Horizontal Adjustment Schema
- LISCADXML-ADJEL-1.0.XSD - S.E.E. Elevation Adjustment Schema
- LISCADXML-TRAVS-1.0.XSD - S.E.E. Traverse Adjustment Schema
- LISCADXML-TRANS-1.0.XSD - S.E.E. Transformation Schema
- LISCADXML-CODES-1.0.XSD - S.E.E. Code Table Schema
LISCAD can produce all these XML files and can read XML files compliant with its database and its horizontal and vertical XML schemas.
The documentation files for the schemas are:
- LISCADXML-SEEDB-2.0.HTML
- LISCADXML-SEEDE-2.0.HTML
- LISCADXML-ADJHZ-1.0.HTML
- LISCADXML-ADJEL-1.0.HTML
- LISCADXML-TRAVS-1.0.HTML
- LISCADXML-TRANS-1.0.HTML
- LISCADXML-CODES-1.0.HTML
What XML naming convention does LISCAD use?
The following five character identifiers are used to describe the following LISCAD functionality
SEEDB - SEE Database
SEEDE - SEE Directive Element
ADJHZ - SEE Horizontal Adjustment
ADJEL - SEE Elevation Adjustment
TRAVS - SEE Traverse
TRANS - SEE Transformation
CODES - SEE Code Table
Version 1.0 of the LISCAD schema names are in the form 'LISCADXML-identifier-1.0.xsd'.
E.g. LISCADXML-SEEDB-1.0.xsd refers to version 1.0 of the LISCAD SEE Data Base file.
The related document files are named accordingly
E.g. LISCADXML-SEEDB-1.0.html
Style sheets distributed with LISCAD, have the following three character purpose used to describe the type of LISCAD style sheet. Click on the links to find out how these are used.
ADI - Adjustment Import
AHE - Adjustment Horizontal Export
AHE - Adjustment Vertical Export
CTE - Code Table Export
DCE - Data Conversion Export
DCI - Data Conversion Import
REP - Report
TVE - Report
HLP - Helper Style Sheet (These style sheets are not used directly, but are called by other style sheets to perform common functions.)
The names are 'purpose description.xsl'.
The three character purpose defining the type of style sheet file is followed by a description.
E.g. REP Codes Used.xsl
HLP GeneralUtilities01.xslt
Note: These naming conventions should be used so that they appear in the correct context they are to be used in. If the 3 character purpose is not used, LISCAD will not know what context to use it in and in this case it will appear in all contexts. Any new documents relating to XML or Style Sheets should follow these conventions.
How does LISCAD use XML?
XML acts as a conduit between LISCAD and other applications or reports.
XML defines data in a text format. LISTECH Pty. Ltd. have defined several LISCAD XML Schemas that represent the complete S.E.E. data base, Least Squares Adjustment data, Transformation data, Traverse data and the LISCAD Code Tables. The reason for doing this is to define a set of XML Files that LISCAD will always understand.
The LISCAD XML files are transformed through the use of style sheets into the final reports or files.
Something unique to style sheets developed for LISCAD is the S.E.E. Directive Element. The S.E.E Directive Element has a twofold function. It allows specific objects from the S.E.E. data base to be selected and it also permits computations to be performed using these objects. These computations would be difficult if not impossible to carry out just using style sheets.
The process for creating a data file that can be read by other applications, or the process for creating a report from LISCAD, are essentially identical.
- The user selects a style sheet to achieve the required output. If no style sheet is selected all data will be output to the XML file.
- If a style sheet has been selected, LISCAD reads the S.E.E. Directive Element from the style sheet. The S.E.E. Directive Element defines what objects are to be selected, and it may generate a user interface allowing the user to select what objects are required.
- LISCAD creates one or more XML files, depending upon the required output, which conforms to the LISCAD XML Schemas. The XML file(s) can contain object attributes and computed data as defined in the S.E.E. Directive Element. The resultant XML files can either be saved for future use or viewing, or they can be temporary and will be discarded once the final output has been produced.
- The XML Engine (Parser). reads the templates from the style sheet and using these instructions transforms the LISCAD XML file(s) into the final reports or files.
The process for reading in data using XML is similar to the output process.
- The user selects an XML file that has been produced by an external application.
- The user selects a style sheet that will transform the XML file into one or more LISCAD XML files based upon the LISCAD XML Schemas. If a style sheet is not selected then it is assumed that the XML file selected conforms to the LISCAD XML Schema.
- The XML Engine (Parser) reads the templates from the style sheet and using these instructions transforms the external XML file into an XML file compatible with the LISCAD XML Schema.
- LISCAD then reads the LISCAD XML file directly into its data base.
To use the XML functionality in LISCAD, the Microsoft XML Parser V4.x, or equivalent, must be installed. This can be downloaded from the Microsoft site www.microsoft.com (Search for MSXML).
What is an XML Parser?
An XML Parser is the engine that processes XML files. The XML Parser is an independent application from LISCAD that reads an XML file, takes instructions from the style sheet and transforms the XML file into the desired output.
This output could be another XML file, a HTML file or some other format e.g. text file. The style sheet determines what the output format is to be.
By default LISCAD uses the Microsoft XML Parser V4.x. This, or an equivalent parser, must be installed on your computer for XML to work. You may find that your system already has this parser installed by default as part of the Windows operating system. What parser will be used is determined by instructions in the style sheet.
The easiest way to determine if the required parser is installed is to try and output an XML file from LISCAD. If the parser cannot be found, you will receive an error message describing the problem.
If you need to install the Microsoft XML Parser V4.x this can be downloaded from the Microsoft site www.microsoft.com (Search for MSXML).
In some cases you may need to use another XML Parser. Currently the Microsoft XML Parser only allows for a single output file, but your output may require more than one file. In this case a different XML Parser will be required. Saxon is an independent parser that can handle multiple output files. Saxon can be found at http://saxon.sourceforge.net/
Why doesn't LISCAD read and write XML and LandXML files directly?
LISCAD does in fact read and write XML files directly, but only those XML files defined by the LISCAD XML Schemas
Because XML is a data definition, it is certainly possible to write any XML files directly. However there are significant disadvantages to this approach.
As an example, LandXML defines a vast amount of survey and object related data. This data may not have an exact match to the data in the application producing or reading the LandXML file. Hence a decision needs to be made about how the LandXML file will be interpreted by the application using it. This leads to different "varieties" of LandXML each of which can be interpreted differently.
To read or write each of these "varieties" of LandXML directly would require a different data conversion to interpret the LandXML file correctly. This would cause exactly the same problems that existed when different data formats and reports were required to be developed.
Instead of developing code within LISCAD to support different XML files, the approach taken using style sheets, ensures that the development of a data conversion or report can be undertaken independently of LISCAD. The use of style sheets means that anyone can develop their own customised output.
Why haven't the current Data Conversions and Reports been replaced with XML?
Many of the current data conversions and reports could be replaced with XML and style sheets. However the developers of LISCAD are always reluctant to remove existing functionality from the software.
In the future new reports and data conversions will be added into LISCAD using XML and style sheets.
Where can I get Style Sheets?
When you install LISCAD some sample style sheets (XSL files) will be installed into the User folder. These are designed to give you some idea of what is capable by using XML and style sheets.
LISTECH Pty. Ltd. will continue to develop new style sheets. As they are completed they will be posted on our web site.
You can also develop your own style sheets either from scratch, or by taking some of the sample style sheets and editing them to suit your requirements.
To check our site for style sheets or to download documentation on the LISCAD XML Schemas go to www.listech.com/liscad/.
New style sheets only need to be copied into the User folder to make them available.
How do I convert data from an external application into an XML file?
Style sheets will only read XML files, they will not read a text file produced by another application, therefore it is necessary to be able to convert data into XML before importing it to LISCAD.
As XML becomes more widely used, applications will start to produce XML files either directly, or by using the approach LISCAD has taken, by creating their own XML Schema. This is already the case with LandXML. Several surveying, mapping and civil engineering applications are already reading and writing their own variety of LandXML enabling them to exchange data with LISCAD through the use of style sheets.
If the application that you want to read the data from does not produce an XML file either directly or through the use of style sheets then you need to be able to export the data in a plain text form. This should not be a problem for most applications. Once a text file has been produced there are other applications that the data can be read into and then exported from in XML format. This is now possible with some spread sheet applications like Microsoft Excel ?.
Can I write my own XML User Interface?
If you want to create a user interface that will appear in LISCAD, you can do this through the S.E.E. Directive Element <SEEDE> in the style sheet.
The S.E.E. Directive Element <Dialog> element allows you to define dialog boxes, what controls will appear on them and the order the dialogs are to appear. You can use any number of dialog boxes in the user interface. This is particularly useful when you have a lot of information to select. Also you can use the same dialog box an unlimited number of times when you need to repeatedly select the same type of data.
When LISCAD reads the <Dialog> element in the style sheet it constructs and displays the dialog. In addition to the dialog box controls defined in the style sheet the dialog box will also have the following buttons.
OK button - Accepts the data in the dialog box.
Cancel button - Closes the dialog box and terminates the operation.
Help button - Displays general help on the use of selecting style sheets.
Notes button - Reads the <UI> element in the style sheet displays specific information about what this style sheet does and how to use it. If the Notes button is disabled it indicates that the style sheet author did not write any user instructions into the style sheet.
If a dialog box has been defined as unbounded it will also display the following:
Repeat button - Allows the user to continue to repeat the input process and enter another set of data.
Count text - This only appears in conjunction with the 'Repeat' button. This indicates the currently active input set and the number of input sets created.
Previous and Next buttons - Allows the user to step forward and backward through input sets and other dialogs as defined by the style sheet author.
What is the S.E.E. Directive Element?
Within the style sheet there is provision for the inclusion of a S.E.E. Directive Element. This concept is unique to LISCAD style sheets and gives the style sheet author and/or user, far greater control over what information is written into the LISCAD XML file.
The S.E.E. Directive Element is written in the style sheet and is entirely independent of the style sheet templates. The S.E.E. Directive Element can optionally instruct LISCAD what to display in the user interface, what objects to select, what object attributes are required and what computed information is to be output.
The style sheet templates perform the transformation of the data into the required output format.
The LISCADXML-SEEDE consists of a base element <SEEDE> which may contain a number of sub-elements. These sub-elements can consist of:
- Any number of dialog elements <Dialog>
- Any number of operation elements <Operation>
- An user instruction element <UI>
<Dialog> elements allow for the inclusion of customised dialog box user interfaces. These will be presented to the user to allow them to select what objects shall be output to the LISCAD XML file.
Each <Dialog> element can contain a number of sub-elements. These sub-elements define what controls can appear on the dialog boxes. Dialog controls allow the user to select, filter or enter data. The style sheet author can limit which objects can be selected from each control. (e.g. only Primary Alignments)
<Operation> elements define the operations to perform on data. An operation can define what objects to select, where they should be selected from, what attributes to get and what computations to perform on the objects.
<UI> element contains the user instructions or help. It is a text description of what the style sheet does and how to use it.
To give the Style Sheet developer some assistance with writing style sheets the S.E.E. Directive Element allows for the inclusion of a Trace File statement:
- <SEEXML traceFilename="C:\MyTraceFile.txt"/>
This will create a file called MyTraceFile.txt in the C:\ folder when the style sheet is run. It will then log to that file the progress of what is happening as the style sheet instructions are processed. If there are any problems, or the output is not what is required this trace file may well give the style sheet developer a clue to what happened.
Inclusion of the S.E.E. Directive Element is optional. If it is not used, then the LISCAD XML file created will contain all LISCAD objects and their intrinsic attributes, but no computed information.
Although the S.E.E. Directive Element is optional it is strongly recommended that it is used. If used, LISCAD can be instructed to be selective in what information it gathers and to perform computations on the selected data. Trying to use the style sheet to perform computations may be extremely difficult, if not impossible. Also style sheets can be written more generically and do not have to be edited every time that a different output data set is required.
The directive element helps separate content selection and computation from presentation in the style sheet.
For further information on the S.E.E. Directive Element refer to LISCADXML-SEEDE-1.0.html.
Where can I learn more about XML and Style Sheets?
To learn the about Style Sheets in general, go to www.w3schools.com. This will help you understand the syntax and give you an overall understanding of the topic.
For specific information about the LISCAD XML Schemas it is important to become familiar with the following documents:
- LISCADXML-SEEDB-2.0.html Documentation for the S.E.E. data base;
- LISCADXML-SEEDE-2.0.html Documentation for the S.E.E. Directive Element
- LISCADXML-ADJHZ-1.0.html Documentation for the Horizontal Least Squares Adjustment
- LISCADXML-ADJEL-1.0.html Documentation for the Vertical Least Squares Adjustment
- LISCADXML-TRAVS-1.0.html Documentation for the Traverse Adjustment
- LISCADXML-TRANS-1.0.html Documentation for the Transformations
- LISCADXML-CODES-1.0.html Documentation for the Code Table
These documentation files can be found on your LISCAD installation CD in the XML Documentation folder.
Alternatively you can download the documentation from the LISCAD web site at www.listech.com/liscad
To get an idea of some of the things that are possible with style sheets open the sample XSL files that have been installed into your User folder. These files can be copied and edited to tailor them for your particular requirements.
Refer to the Tutorials on XML and Style Sheets. The Tutorials can be accessed from the Help / Tutorials menu on the main menu.
The following Tutorials are currently available:
- SEEXML Structure and Syntax
- XSL Style Sheets - An Introduction
- XSL Style Sheets - User Interface and Helper Files
- XSL Style Sheets - Interface Controls
- XSL Style Sheets - Interface Filter Controls
- XSL Style Sheets - Using Parameter Controls
- XSL Style Sheets - Tailored Input / Output