+gkrone Posted June 26, 2007 Share Posted June 26, 2007 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, Quote Link to comment
+Miragee Posted June 26, 2007 Share Posted June 26, 2007 Just curious . . . What are you trying to do? Quote Link to comment
+gkrone Posted June 26, 2007 Author Share Posted June 26, 2007 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, Quote Link to comment
robertlipe Posted June 26, 2007 Share Posted June 26, 2007 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. Quote Link to comment
Recommended Posts
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.