Hi Ceaser,
A LandXML file is an XML file - it just uses a tag set specific to the 'schema' defined by the LandXML group. A 'generic' XML file is also constructed according to a schema, just a different, less specific one.
The point of any schema is to define 2 basic characteristics of a dataset, the contents and the structure. The contents are divided up into 3 types of data: Elements which are the 'things' in a dataset, Attributes which tell you about the 'things' and CDATA which is the text inside a 'thing'. A simple example might be:
<para author="DW">Some text</para>
para is the thing - a paragraph, it has an attribute 'author' which tells who wrote it and it's visible content is 'Some text'
The structure describes the order in which the elements can appear within the dataset. For example, for a book the basic structure might be described as:
Book contains one
Title followed by one or more
Chapters, followed by an optional
Index; The next level down is
Chapter which has one attribute '
number' and contains one
Title followed by one or more
Sections.
Using this hierarchy a complete dataset can be created - and controlled so that you don't allow a Book with no content or a Chapter with 2 titles.
It's a bit like a database but every record can have a different and variable field structure.
The schema can be a standard one available from a number of sources, however the more generic a schema is, the less control it can exert over a dataset (in some cases it might be quite valid to have more than one title for a chapter even if
you don't want that). The LandXML schema is a good example of that. it defines elements, attributes and structure that only have real meaning within the world of surveying. It defines things such as
Lat/Long,
Roadway and
Monument. These have very specific meanings - but only within the LandXML schema. There may well be a definition for
Monument in a government schema but that will probably be a quite different definition as it addresses other aspects such legal status.
Anyway, to the practical aspects of actually reading or writing an XML file...
Andrew Graham has just this week created a DLL wrapper for the NET XML reader and writer classes. This gives us the ability to quickly and efficiently to use XML documents. I suggest you take a look at the posts concerning this DLL (
http://www.b4x.com/forum/additional-libraries/3385-xml-library.html) I have so far used the XMLreader and it is very simple and quick.
Once you have read the XML file it is up to you as the programmer to decide what to do with each element and attribute that comes out of the document. That is where your knowledge of surveying (and the intentions of the schema) become invaluable. Data is nothing until you do something with it - and only you can decide what you want to do with it!
When writing an XML file it again up to you to ensure that the file you create conforms to the schema you are using. The data elements and attributes have to be in the right order and their contents have to follow the rules set out for them. If you are saving a date and the schema specifies ISO format then putting "22Nov08" will not be valid!
Is this of any use? Sorry if it turned into a sermon - I spend over a decade doing nothing but working with SGML (a forerunner of XML) so it became a bit of a religion for me
. Let me know if you have any specific questions!
David.