Multiple Root Elements in Garmin POIs - is it legal XML?

Discussion in 'XML' started by Ramon F Herrera, Dec 18, 2007.

  1. 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/GpxExtensions/v3/GpxExtensionsv3.xsd">

    <metadata>
    <link href="http://www.garmin.com">
    <text>Garmin International</text>
    </link>
    <time>2007-12-01T22:59:07Z</time>
    </metadata>
    [...]
    Ramon F Herrera, Dec 18, 2007
    #1
    1. Advertising

  2. Ramon F Herrera

    Guest

    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.
    , Dec 19, 2007
    #2
    1. Advertising

  3. Ramon F Herrera

    Guest

    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.
    , Dec 19, 2007
    #3
  4. On Dec 18, 11:48 pm, 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
    Ramon F Herrera, Dec 20, 2007
    #4
  5. Re: Multiple Root Elements in Garmin POIs - is it legal XML? It is aMicrosoft BUG

    I was able to reduce the problem of the rejected XML file to its
    minimum expression.

    This file: good, proper and valid, is rejected by Visual Studio:

    http://patriot.net/~ramon/xml/with-extensions.xml

    I get the following error message when I try to convert the file above
    using <right-click> "View Data Grid":

    http://patriot.net/~ramon/xml/ErrorMess.png

    Notice that the error says "Line 37" but the file in question only has
    27 lines.

    When I remove the "extensions" element, the file is processed and
    properly converted.

    http://patriot.net/~ramon/xml/no-extensions.xml

    If anyone out there has Visual Studio, can you please check both
    files?

    How do I go about reporting this to Microsoft?

    This is my version info:

    http://patriot.net/~ramon/xml/VS-version.png

    TIA,

    -Ramon
    Ramon F Herrera, Dec 20, 2007
    #5
  6. Ramon F Herrera

    Bruce Guest

    Re: Multiple Root Elements in Garmin POIs - is it legal XML? It is a Microsoft BUG

    I'm not very expert at XML schema but I think the schema is saying that the
    extensions element cannot be inside the waypoint element. I don't know how
    the extensions is then linked with a waypoint, via the name mabye?

    "Line 37" is probably referring to a line in the schema.


    "Ramon F Herrera" <> wrote in message
    news:...
    >
    > I was able to reduce the problem of the rejected XML file to its
    > minimum expression.
    >
    > This file: good, proper and valid, is rejected by Visual Studio:
    >
    > http://patriot.net/~ramon/xml/with-extensions.xml
    >
    > I get the following error message when I try to convert the file above
    > using <right-click> "View Data Grid":
    >
    > http://patriot.net/~ramon/xml/ErrorMess.png
    >
    > Notice that the error says "Line 37" but the file in question only has
    > 27 lines.
    >
    > When I remove the "extensions" element, the file is processed and
    > properly converted.
    >
    > http://patriot.net/~ramon/xml/no-extensions.xml
    >
    > If anyone out there has Visual Studio, can you please check both
    > files?
    >
    > How do I go about reporting this to Microsoft?
    >
    > This is my version info:
    >
    > http://patriot.net/~ramon/xml/VS-version.png
    >
    > TIA,
    >
    > -Ramon
    Bruce, Dec 20, 2007
    #6
  7. Re: Multiple Root Elements in Garmin POIs - is it legal XML? It is aMicrosoft BUG

    On Dec 20, 10:11 am, "Bruce" <> wrote:
    > I'm not very expert at XML schema but I think the schema is saying that the
    > extensions element cannot be inside the waypoint element. I don't know how
    > the extensions is then linked with a waypoint, via the name mabye?
    >


    There is definitely something wrong with the 'extensions' element. In
    my simplified example, all I had to do was to remove the one and only
    'extensions' element, and VS processed the XML file properly.

    As a further test I took my whole list of waypoints (actually, POIs)
    and removed every single 'extensions' element. Again, the file was
    processed without any problems.

    It remains to be determined whether this problem is a Garmin screwup,
    or a Microsoft screwup. Since Sun (via NetBeans' "Check XML" and
    "Validate XML") says the file is fine, and IBM (via Eclipse) concurs,
    I am inclined to place the blame on Microsoft.

    -Ramon
    Ramon F Herrera, Dec 20, 2007
    #7
  8. Ramon F Herrera

    Bruce Guest

    Re: Multiple Root Elements in Garmin POIs - is it legal XML? It is a Microsoft BUG

    I am inclinded to place the blame on ramon
    "Ramon F Herrera" <> wrote in message
    news:...
    > On Dec 20, 10:11 am, "Bruce" <> wrote:
    >> I'm not very expert at XML schema but I think the schema is saying that
    >> the
    >> extensions element cannot be inside the waypoint element. I don't know
    >> how
    >> the extensions is then linked with a waypoint, via the name mabye?
    >>

    >
    > There is definitely something wrong with the 'extensions' element. In
    > my simplified example, all I had to do was to remove the one and only
    > 'extensions' element, and VS processed the XML file properly.
    >
    > As a further test I took my whole list of waypoints (actually, POIs)
    > and removed every single 'extensions' element. Again, the file was
    > processed without any problems.
    >
    > It remains to be determined whether this problem is a Garmin screwup,
    > or a Microsoft screwup. Since Sun (via NetBeans' "Check XML" and
    > "Validate XML") says the file is fine, and IBM (via Eclipse) concurs,
    > I am inclined to place the blame on Microsoft.
    >
    > -Ramon
    >
    Bruce, Dec 20, 2007
    #8
  9. Ramon F Herrera

    Simon Slavin Guest

    On 18/12/2007, Ramon F Herrera wrote in message <8b6caa8f-1e33-4b1c-8d25-
    >:

    > <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
    Simon Slavin, Dec 20, 2007
    #9
  10. Ramon F Herrera

    Guest

    On Dec 20, 1:19 am, Ramon F Herrera <> 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.
    , Dec 21, 2007
    #10
  11. Ramon F Herrera

    Simon Slavin Guest

    Re: Multiple Root Elements in Garmin POIs - is it legal XML? It is a Microsoft BUG

    On 19/12/2007, Ramon F Herrera wrote in message <8c2b2666-7519-4539-9d09-
    >:

    > This file: good, proper and valid, is rejected by Visual Studio:
    >
    > http://patriot.net/~ramon/xml/with-extensions.xml
    >
    > I get the following error message when I try to convert the file above
    > using <right-click> "View Data Grid":
    >
    > http://patriot.net/~ramon/xml/ErrorMess.png
    >
    > Notice that the error says "Line 37" but the file in question only has
    > 27 lines.
    >
    > When I remove the "extensions" element, the file is processed and
    > properly converted.
    >
    > http://patriot.net/~ramon/xml/no-extensions.xml


    Here are three possibilities: (A) VS can't handle the 'extensions' part of
    the original XML file, (B) it can't access the schema file used to define
    the extensions, (C) it can't handle the contents of the schema file.

    Here's the schema file:

    <http://www.topografix.com/GPX/1/1/gpx.xsd>

    I have some experience with this set of extensions and as far as I can see
    the syntax in all cases is fine. I have no Windows system to experiment
    with.

    Simon.
    --
    http://www.hearsay.demon.co.uk
    Simon Slavin, Dec 22, 2007
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    1,192
  2. Andy Fish
    Replies:
    1
    Views:
    486
    PaulC
    Aug 18, 2003
  3. Joe

    Multiple Root Elements Problem

    Joe, Nov 28, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    330
  4. Teijo Korhonen

    Re: Keskinen vetää kossualensa pois

    Teijo Korhonen, Jun 22, 2008, in forum: XML
    Replies:
    0
    Views:
    489
    Teijo Korhonen
    Jun 22, 2008
  5. cmalmqui
    Replies:
    2
    Views:
    1,950
    cmalmqui
    Mar 30, 2009
Loading...

Share This Page