Validation Error: Unexpected id attribute on foo element

9 views
Skip to first unread message

Lou

unread,
Oct 26, 2009, 4:18:37 PM10/26/09
to KML Developer Support - Getting Started with KML
I ran my KML through feedvalidator.org and got the following errors:

line 1788, column 1: Unexpected id attribute on Location element (6
occurrences)
<Location id="cargoLocation">

line 1793, column 1: Unexpected id attribute on Orientation element (3
occurrences)
<Orientation id="cargoOrientation">

line 1798, column 1: Unexpected id attribute on Scale element (6
occurrences)
<Scale id="cargoScale">

http://feedvalidator.org/docs/error/UnexpectedAttribute.html


I don't understand why I'm getting these errors, nor do I understand
what this error means. Can anyone clarify this error? Thanks.


The section (with line numbers) of the KML that the validator has
issues with:
1782 <!-- cargo model 1 -->
1783 <Placemark id="cboat">
1784 <name>Cargo Boat 1</name>
1785 <visibility>0</visibility>
1786 <Model id="model_14">
1787 <altitudeMode>absolute</altitudeMode>
1788 <Location id="cargoLocation">
1789 <longitude>-126.40</longitude>
1790 <latitude>75.21</latitude>
1791 <altitude>0</altitude>
1792 </Location>
1793 <Orientation id="cargoOrientation">
1794 <heading>0</heading>
1795 <tilt>0</tilt>
1796 <roll>0</roll>
1797 </Orientation>
1798 <Scale id="cargoScale">
1799 <x>1500</x>
1800 <y>1500</y>
1801 <z>1500</z>
1802 </Scale>
1803 <Link>
1804 <href>files/models/cargo.dae</href>
1805 </Link>
1806 </Model>
1807 </Placemark>

The section that animates the model:
714 <!-- cargo boat visible -->
715 <gx:AnimatedUpdate>
716 <gx:duration>0.5</gx:duration>
717 <Update>
718 <targetHref></targetHref>
719 <Change><Placemark targetId="cboat"><visibility>1</visibility></
Placemark></Change>
720 </Update>
721 </gx:AnimatedUpdate>
722
723 <!-- cargo boat movement #1 -->
724 <gx:AnimatedUpdate>
725 <gx:duration>5</gx:duration>
726 <Update>
727 <targetHref></targetHref>
728 <Change>
729 <Location targetId="cargoLocation">
730 <longitude>-156.9</longitude>
731 <latitude>72.6</latitude>
732 <altitude>0</altitude>
733 </Location>
734 </Change>
735 <Change>
736 <Orientation targetId="cargoOrientation">
737 <heading>0</heading>
738 <tilt>0</tilt>
739 <roll>0</roll>
740 </Orientation>
741 </Change>
742 </Update>
743 </gx:AnimatedUpdate>

jmatthews

unread,
Oct 26, 2009, 5:06:39 PM10/26/09
to KML Developer Support - Getting Started with KML
You are using features I do not use, but I don't think you can use "id
= ..." in those features.

In the KML reference, if you can use "id = ...", it will tell you
that. For example, look at the KML reference description of
<Document>. http://code.google.com/apis/kml/documentation/kmlreference.html#document

It shows you <Document id="ID">

Do the same for <Folder> and <Placemark>, both of which can contain
id's.

Now, look at the reference for <Location>.
http://code.google.com/apis/kml/documentation/kmlreference.html#location
It only shows <Location>. There is no "id = ..." option.

The same is true for <Orientation> and <Scale>.

Lou

unread,
Oct 30, 2009, 3:46:51 PM10/30/09
to KML Developer Support - Getting Started with KML


On Oct 26, 1:06 pm, jmatthews wrote:
> You are using features I do not use, but I don't think you can use "id
> = ..." in those features.
>
> In the KML reference, if you can use "id = ...", it will tell you
> that.  For example, look at the KML reference description of
> <Document>.  http://code.google.com/apis/kml/documentation/kmlreference.html#document
>
> It shows you <Document id="ID">
>
> Do the same for <Folder> and <Placemark>, both of which can contain
> id's.
>
> Now, look at the reference for <Location>.http://code.google.com/apis/kml/documentation/kmlreference.html#location
> It only shows <Location>.  There is no "id = ..." option.
>
> The same is true for <Orientation> and <Scale>.

Thank you for the reply. I decided to continue using "id" in Location
and Scale because I could not find another way to animate the model.
Seems to work most of the time.
Reply all
Reply to author
Forward
0 new messages