|
Cellular forums Home > Archive > Garmin GPS > December 2007 > Multiple Root Elements in Garmin POIs - is it legal XML?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Multiple Root Elements in Garmin POIs - is it legal XML?
|
|
| Ramon F Herrera 2007-12-18, 10:33 pm |
|
I extracted the file 'current.gpx' from my Garmin n=FCvi GPS to take a
look at its contents. See its first lines below.
NetBeans and Eclipse have no problem with it, but when I try to
perform the "View Data Grid" operation in Visual Studio, I get this
message:
"This XML document is not well formed. It contains the following
error: There are multiple root elements".
These are the lines in which it is choking, apparently on
"ele" (elevation)
<wpt lat =3D"10.036995" lon =3D"-69.242541">
<ele>423.583374</ele>
<name>A Cabudare Via</name>
<sym>Flag, Blue</sym>
</wpt>
Perhaps the word 'ele' is reserved for element?
-Ramon
<?xml version=3D"1.0" encoding=3D"UTF-8" standalone=3D"no" ?>
<gpx xmlns=3D"http://www.topografix.com/GPX/1/1"
xmlns:gpxx=3D"http://www.garmin.com/xmlschemas/GpxExtensions/v3"
creator=3D"n=FCvi 660" version=3D"1.1"
xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=3
D"http://www.topografix.com/GPX/1/1
http://www.topografix.com/GPX/1/1/gpx.xsd http://www.garmin.com/xmlschemas/G=
pxExtensions/v3
http://www.garmin.com/xmlschemas/Gp...xtensionsv3.xsd">
<metadata>
<link href=3D"http://www.garmin.com">
<text>Garmin International</text>
</link>
<time>2007-12-01T22:59:07Z</time>
</metadata>
[...]
| |
| Phil Hornby 2007-12-18, 10:33 pm |
| "Ramon F Herrera" <ramon@conexus.net> wrote in message
news:8b6caa8f-1e33-4b1c-8d25- a4597e9f7a7e@l1g2000
hsa.googlegroups.com...
I extracted the file 'current.gpx' from my Garmin nüvi GPS to take a
look at its contents. See its first lines below.
NetBeans and Eclipse have no problem with it, but when I try to
perform the "View Data Grid" operation in Visual Studio, I get this
message:
"This XML document is not well formed. It contains the following
error: There are multiple root elements".
These are the lines in which it is choking, apparently on
"ele" (elevation)
<wpt lat ="10.036995" lon ="-69.242541">
<ele>423.583374</ele>
<name>A Cabudare Via</name>
<sym>Flag, Blue</sym>
</wpt>
Perhaps the word 'ele' is reserved for element?
-Ramon
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<gpx xmlns="http://www.topografix.com/GPX/1/1"
xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3"
creator="nüvi 660" version="1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.topografix.com/GPX/1/1
http://www.topografix.com/GPX/1/1/gpx.xsd
http://www.garmin.com/xmlschemas/GpxExtensions/v3
http://www.garmin.com/xmlschemas/Gp...xtensionsv3.xsd">
<metadata>
<link href="http://www.garmin.com">
<text>Garmin International</text>
</link>
<time>2007-12-01T22:59:07Z</time>
</metadata>
[...]
I reconstitued your file and saved it as a UTF-8 text file from notepad. The
resulting file loads successfully in GeePeeEx Editor (which uses Microsoft's
MSXML-6 parser). It doesn't pass the 'official' test of gpx validity,
(http://www.topografix.com/gpx_validation.asp), because the schema's
pointing to the wrong place - maybe that's what was upsetting Visual Studio.
--
http://GeePeeEx.googlepages.com
GPX Editor for Garmin Automotive Units
| |
| keshlam-nospam@comcast.net 2007-12-18, 10:33 pm |
| Visual Studio is correct. A well-formed XML document may not have more
than one root element; if this file does it may be an XML External
Entity (intended to be embedded into another XML document which will
act as a wrapper) but isn't a well-formed XML document by itself.
Not having seen your entire file, and not knowing anything about this
particular product, I can't comment beyond that.
| |
| keshlam-nospam@comcast.net 2007-12-18, 10:33 pm |
| Actually, what the other tools may be doing is taking the first root
element and silently ignoring the later one(s). That's legal, by the
XML Recommendation's rules, but I think warning you that you aren't
getting what you intended probably is preferable.
| |
| Ramon F Herrera 2007-12-20, 4:33 am |
| On Dec 18, 11:48 pm, keshlam-nos...@comcast.net wrote:
> Actually, what the other tools may be doing is taking the first root
> element and silently ignoring the later one(s). That's legal, by the
> XML Recommendation's rules, but I think warning you that you aren't
> getting what you intended probably is preferable.
Man, you DO have a blind trust on Microsoft, don't you?
The file has a single root.
Visual Studio displays the file properly and the minus and plus signs
work as expected. I can click on the one and only root, and the whole
tree collapses. It is only when I try to do the conversion to grid
that it fails.
Can a Garmin owner out there verify his/her POIs file, please?
-Ramon
| |
| Simon Slavin 2007-12-20, 10:33 pm |
| On 18/12/2007, Ramon F Herrera wrote in message <8b6caa8f-1e33-4b1c-8d25-
a4597e9f7a7e@l1g2000
hsa.googlegroups.com>:
> <wpt lat =3D"10.036995" lon =3D"-69.242541">
If the '3D's in the lines you quoted are in your text file, then that's
the problem. Can you check ?
Simon.
--
http://www.hearsay.demon.co.uk
| |
| keshlam-nospam@comcast.net 2007-12-21, 12:33 pm |
| On Dec 20, 1:19 am, Ramon F Herrera <ra...@conexus.net> wrote:
> Man, you DO have a blind trust on Microsoft, don't you?
Not sure where that came from. Oh well.
> The file has a single root.
Since you didn't show us the full document, but did give us the error
message, I presumed the error message was correct... especially since
it would be a surprising one to get wrong. If you're certain the
message is wrong, take that up with the authors of the failing parser.
|
|
|
|
|