DOMParser does not apply CSS styles or inheritance logic—it parses the XML statically. So inherited styles or properties via <g> or <style> won't be available directly via getAttribute() or .attributes.
If you can work in a browser context (not just parsing XML in memory), then: Inject the SVG string into the DOM (e.g., into a hidden <div>). Query the <path> element using querySelector. Use getComputedStyle() to get inherited or computed style values.