From: Dr Josef Karthauser <joe@ka...> - 2013-11-26 20:41:04
I'm developing a RESTXQ/xforms application, and have stumbled across a small issue, and was wondering what the best practices dictate that I should do. I'd be very grateful for an expert opinion.
My REST endpoint consumes XML (POSTed). One particular file contains DOCTYPE in it's preamble.
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 17.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink"; x="0px" y="0px"…>
<!-- the rest of the file -->
This is ok, as far as the REST side concerned, but it's also being parsed by my xforms when I "GET" it later on (in an <xf:submission>). This appears to cause woe as betterforms complains that it can't parse the XML… :(. If I remove the <!DOCTYPE> on the file I upload then it's perfectly fine.
However, in the file, I'm expecting that I'll see documents exactly like this.
Should I be stripping the DTD entries in the POST endpoint? What's the best way to do this? And, is it a bug that betterforms complains so much?