Menu

#32 XML output fails with binary columns

open
5
2010-08-17
2006-08-09
No

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="&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;&#0;"
remarks=""/>

Character 126 is the first &#0;. Same error in both
Opera and Firefox.

I don't actually have any default value set for the
column.

Discussion

  • John Currier

    John Currier - 2006-08-09

    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

     
  • John Currier

    John Currier - 2006-08-29

    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

     
  • John Currier

    John Currier - 2006-08-29

    With UTF8 XML

     
  • John Currier

    John Currier - 2006-10-18

    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

     
  • John Currier

    John Currier - 2008-10-22

    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

     
  • John Currier

    John Currier - 2010-08-17

    This issue should be resolved in release 5.0.0.

     
  • John Currier

    John Currier - 2010-08-17
    • status: open --> pending
     
  • Brian Papantonio

    Keep up the good work :)

     
  • Brian Papantonio

    • status: pending --> open
     

Log in to post a comment.