XML output fails with binary columns
Brought to you by:
johncurrier
Gentoo with MySQL 5.0.19.
XML parsing failed: syntax error (Line: 1318,
Character: 126)
invalid character reference in attribute value
http://www.w3.org/TR/REC-xml/
<column id="2" name="password" type="binary" size="64"
digits="0" nullable="false" autoUpdated="false"
defaultValue="����������������������������������������������������������������"
remarks=""/>
Character 126 is the first �. Same error in both
Opera and Firefox.
I don't actually have any default value set for the
column.
Logged In: YES
user_id=1264584
I was under the impression that the XML formatter that I'm
using would "do the right thing" with binary data. It looks
like I was wrong...
John
Logged In: YES
user_id=1264584
Brian, can you try the attached jar and let me know if it
makes a difference? This one writes the xml in UTF8, so I'm
hoping that it'll behave better.
Actually I kind of doubt it, but it's worth a try. What
does the data in the associated html page look like?
John
With UTF8 XML
Logged In: YES
user_id=1264584
Brian, when I first read this I mis-understood what was
going on. Now that I understand it I really don't know what
I can do to fix it. XML only allows a specific set of
characters and binary zeros aren't on the list.
I should be able to determine that a column is binary and
possibly just give a 2 hex character representation of each
byte. I'm not sure what else can be done.
John
It took a while but I think I finally came up with a regular expression that'd determine if the default value is representable in XML in Unicode: "^[\u0009\n\r -\uD7FF\uE000-\uFFFD\p{L}\p{M}\p{Z}\p{S}\p{N}\p{P}]*$"
If invalid XML is detected it'll give the hex representation of it and set include defaultValueIsBinary="true".
I've uploaded a jar with the fix in it to http://schemaspy.sourceforge.net/schemaSpy.jar. Please let me know if this resolves the issue.
John
This issue should be resolved in release 5.0.0.
Keep up the good work :)