informatics-isi-edu / openseadragon-viewer

2D viewer with openseadragon
Apache License 2.0
5 stars 2 forks source link

Properly handle namespace #30

Open RFSH opened 4 years ago

RFSH commented 4 years ago

Currently, we're using JavaScript's DOMParser API to extract information from the SVG file. We should make sure the APIs that we use are namespace-aware and properly handle namespace.

For example, in the code, we're specifically looking for nodeName API value of g (to find <g> elements). If we use namespace and declare the element as <svg:g> will the code be able to handle it?

This MDN doc might be useful for learning more about namespaces.