If I remove all namespaces and prefixes, my XSLT transformations work perfectly.
I've had a few attempts at introducing the namespaces but always end up with some sort of error or no output, so here I am looking for a bit of help and understanding.
My expected output, whittled down to namespaces and prefixes, is:
<?xml version="1.0" encoding="utf-8"?>
<gpx xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="1.0" creator="GSAK"
xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd http://www.groundspeak.com/cache/1/0/1 http://www.groundspeak.com/cache/1/0/1/cache.xsd http://www.gsak.net/xmlv1/6 http://www.gsak.net/xmlv1/6/gsak.xsd"
xmlns="http://www.topografix.com/GPX/1/0">
<desc>...</desc>
<author>...</author>
<wpt lat="..." lon="...">
<name>...</name>
...
<gsak:wptExtension xmlns:gsak="http://www.gsak.net/xmlv1/6">
<gsak:DNF>...</gsak:DNF>
...
</gsak:wptExtension>
<groundspeak:cache id="..." available="..." archived="..." xmlns:groundspeak="http://www.groundspeak.com/cache/1/0/1">
<groundspeak:name>...</groundspeak:name>
</groundspeak:cache>
</wpt>
<wpt lat="..." lon="...">
...
</wpt>
</gpx>
The XML input, again whittled down, is:
<AdventureModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/GamePlayer.Business.WebAPI.Contracts.Models">
<Message i:nil="..."/>
<DeepLink>..</DeepLink>
<Description>...</Description>
...
<GeocacheSummaries>
<GeocacheSummaryModel>
<Mode i:nil="..."/>
<Id>...</Id>
<Location>
<Altitude i:nil="..."/>
<Latitude>...</Latitude>
<Longitude>...</Longitude>
</Location>
...
</GeocacheSummaryModel>
<GeocacheSummaryModel>
...
</GeocacheSummaryModel>
</GeocacheSummaries>
...
</AdventureModel>
What do I need to add to the XSLT header to achieve correct namespace transformation?
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
...
</xsl:stylesheet>