OK now that was fun. Well I ended up installing the simple to use
Editix-XML Editor. This editor makes working with golfml XML and XSL
files very simple, it also has a simple transform tool for converting
klm to xml and xml to svg or any other xml format.
Anyways, I found out what was causing all these errors when
transforming the golfml2svg. It turns out that when I save my google
earth place as KML it throws a empty line for <position><gps lat=""
lon=""/> at the end of every placemark. It also generates a white
space at the first line positions #1 so basically a polygon would have
the coodinates messed up on the first line and the last would be
empty. What was weird was that because the first line had a space in
it the KML2golfml would out put the first lat coordinate as and
Encoded string. I am not sure if it is Google Earth that is Malformed
or just the output from the kml2golfml conversion.
<aoi type="hole-contour">
<name>hole 15 contour</name>
<description/>
<position number="1">
<gps
lon="
									-121.3413512156024"
lat="38.00632405040819" alt="0"/>
</position>
<position number="2">
<gps lon="-121.3414357884927"
lat="38.00609234182868" alt="0"/>
</position>
<position number="3">
<gps lon="-121.3413323262345"
lat="38.00606082739143" alt="0"/>
</position>
....................
....................
....................
<position number="34">
<gps lon="-121.3413512156024"
lat="38.00632405040819" alt="0"/>
</position>
<position number="35">
<gps lon="" lat="" alt=""/>
</position>
</aoi>
The fix was to find a quick way to fix both errors, What I did to
convert all instances of the lat coordinate in position 1 was just to
use Editix to apply the Pretty Style Formating, That would convert all
encoded lat strings to a numeric value. What you were left with was
position 1 with about 5 tabs of space. Removed the space using find
and replace in dreamweaver, Also used dreamweaver to find and replace
all instances of the empty <position number="35"><gps lon="" lat=""
alt=""/> the trick here was to dynamically find all empty position
numbers with a regex expression like so ( <position number=" [^']*
"<gps lon="" lat="" alt=""/>
Anyways some cool code thanks for hosting on google. Be back to chat
after I figure out what i want to use it for besides making my local
course.
I do have one recommendation and that would be to also make the
dynamic distance script touchable for touch devices. I was hacking
around in the SVG and added a draggable element using iphones
ontouchmove and ontouchstart but when I would apply it to target I
could not get it to drag/move.
Thanks, Jason