I have local HTML files that I’m displaying with a UIWebView. Everything is displaying fine, except images embedded in a svg-tags, like such:
<body>
<div>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="100%" height="100%" viewBox="0 0 274 500" preserveAspectRatio="none">
<image width="274" height="500" xlink:href="cover.jpeg"/>
</svg>
</div>
</body>
Normal <img> tags work fine, so there’s nothing wrong with the baseURL, and the image is in the same folder. The HTML file loads fine in Mobile Safari.
I’ve tried loading with -loadRequest:, and -loadString:baseURL: and -loadData:MIMEType:textEncodingName:baseURL, but I always just get a border corresponding to the width and height of the image, without the actual image.
What could be wrong?
Finally solved the issue. The DOCTYPE was set to strict XHTML:
but the file extension was html.
Changing the file extension to .xhtml solved the problem.