I am trying to import an image from an SVG format into the software I am working with. For example, I have an SVG like this:
<svg height="100" width="100">
<text>I Love SVG!
<tspan> NOT! </tspan>"
</text>
</svg>
When processing this data the 'text' element, I have TextString= "element.getTextContent()". This makes TextString = "I Love SVG! NOT!" when all I want is "I Love SVG!". So the getTextContent method returns the text from the element and its child elements, when I don't want to include the child elements text.
Is there a simple way to grab only the text content of an element without getting the child nodes text as well? Thanks