Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using xmldom as default DOMParser #86

Open
codebyshennan opened this issue Sep 6, 2021 · 1 comment
Open

Using xmldom as default DOMParser #86

codebyshennan opened this issue Sep 6, 2021 · 1 comment

Comments

@codebyshennan
Copy link

This library has been of great help, but the guide should be clear that in NodeJS usage, another DOMParser (e.g. xmldom) should be included as an argument in 'importFromGPX()'. Had to trawl the importer js files to find out.

In the case of Node JS:
npm i xmldom

import {SportsLib} from '@sports-alliance/sports-lib';
import { DOMParser } from 'xmldom'

// For GPX you need a string 
const gpxString = 'Some string from a file etc';
SportsLib.importFromGPX(gpxString, DOMParser).then((event)=>{
...
});
@jimmykane
Copy link
Collaborator

Thank you very much for taking the time to report this. A PR is welcome, as I am on vacation atm

Thanks again and may you have a great week

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

No branches or pull requests

2 participants