I try to examine uploaded SVG graphics and look for image elements to read there href attribute. I am using Batik 1.7 to search for corresponding elements. By using 'getElementsByTagName' / 'getElementsByTagNameNS'
I only get an empty list. Here is my code:
try{
String parser = XMLResourceDescriptor.getXMLParserClassName();
SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
SVGDocument doc = f.createSVGDocument(null, upload.getInputStream());
NodeList list = doc.getElementsByTagNameNS("http://www.w3.org/2000/svg", "image");
}
catch(Exception e){
}
So what I am missing here?