Skip to content

Conversation

@jgillich
Copy link
Collaborator

I didn't go the generics route because you'd have to provide like 10 type args to the decoder. Instead it uses xmlutil's Element (the equivalent of JsonObject)

The gpx module should be pretty much feature complete now

<sat>9</sat>
<extensions>
<gpxtpx:TrackPointExtension
xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v1">
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xmlutil quirk: namespace declarations are added to each element instead of the root only. There is a isCollectingNSAttributes config option to configure this, but it does not seem to work for dynamic namespaces in Elements


// ElementSerializer doesn't work in NodeJS because DOMParser is only available in browser
// https://github.com/pdvrieze/xmlutil/issues/298
tasks.named("jsNodeTest") { enabled = false }
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could polyfill DOMParser on node like

import { DOMParser } from 'xmldom';
global.DOMParser = DOMParser;

But I failed to get that set up. Maybe another time

@jgillich jgillich requested a review from sargunv October 29, 2025 11:40
@sargunv sargunv merged commit ac03fde into maplibre:main Oct 31, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants