Jump to content

xsd for loc files


gkrone

Recommended Posts

Does anyone have an xsd file that can be used with the loc files?

 

The problem I am having is getting the cache id, "GCXXX" out of the id attribute in the name element. I have the same type of problem getting the lat and lon attributes out of the coord element.

 

Thanks,

Link to comment

Just curious . . . What are you trying to do?

 

I am experimenting in .net and would like to load the LOC file into a datagrid. Since the LOC file is nothing but an XML file I can use an XmlDataDocument to read the file. An XSD to describe the file makes the loading of the data as well as the display a total of about 6 lines of code:

 

xdoc = new XmlDataDocument();

xdoc.DataSet.ReadXmlSchema("myexample.xsd");

xdoc.Load(isFile);

LocationDataGrid.DataSource = xdoc.DataSet;

LocationDataGrid.DataMember = "waypoint";

LocationDataGrid.Refresh();

 

Since I am basically using this as a learning tool and am not that familiar with XSD I am having trouble with the name and coord elements of the XML. I can't quite figure out how to get the id, lat and lon attributes to be considered as part of the data for those elements.

 

If I can't figure out the XSD then I will have to go back to parsing the XML file into a DataSet programmatically. I have done this before, but it can be tedious.

 

Thanks,

Link to comment

The .loc from this site predates the trendy XML. I don't think an XSD was ever published. GPX solves a lot of those problems and there are XSDs for the core GPX and the Groundspeak extensions that appear in the pocket queries.

 

GPSBabel can convert the .loc to GPX which will add the xmlns/xsi entries to the xsd but doesn't solve the alchemy problem of making a PQ out of a .loc.

 

.loc files are pretty simple. Crafting your own XSD wouldn't be hard.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...