Liquibase validation: can we turn it off?

Hi.  Looks like the SAX parser in Liquibase can’t have validation turned off.

I understand why that might be, but.  :slight_smile:

My real problem is that I have an enormous changelog file that I’ve grafted together from lots of other component changelog files.

Validation fails in a particular spot, claiming that there are CHARACTER elements inside an statement, which is patently false.  I’ve looked at it with a hex editor.  There aren’t.  The place it fails is in a statement like this (which has hundreds of identical statements in front of it:

                                                       

Line 5, column 14 of the snippet above is where the parser says it’s invalid:

    Error parsing line 2073 column 14 of foo-changelog.xml: cvc-complex-type.2.3: Element 'insert' cannot have character [children], because the type's content type is element-only.

It’s a newline character in UTF8, like hundreds of newline characters before it.  In reality, line 5 above is actually line 2073 in my real changelog file.

Nathan, could you allow for validation to be switched off, or perhaps adjust the 2.0 schema to be a little more permissive of character elements in elements?

I’m happy to post the huge changelog.xml if that would help.

Best,
Laird

Also, if it helps, I’m writing my changelog file with the Woodstox XMLEventWriter.  The default Sun STaX implementation is so woefully broken as to be completely unusable.

Except where there are actual character elements (as in, for example, the body of a tag), I am putting out spaces like this:

    xmlWriter.add(this.eventFactory.createIgnorableSpace("  ")); xmlWriter.add(this.eventFactory.createIgnorableSpace("\n")); // choice of \n is deliberate, per http://www.w3.org/TR/REC-xml/#sec-line-ends

So is followed by a new line as generated above.  Nothing else.

L

I went ahead and “resolved” my problem by eliminating all spaces and newlines from my composite changelog.  I can’t read it, but then again I don’t have to.    :slight_smile:

Best,
Laird

I’d rather not support having validation turned off.  I think there are places in the liquibase code that assume that the XML is actually correct based on the validation and I’m not sure what would happen if it isn’t. 

I haven’t had any issues with whitespace.  It should generally treat it as insignificant, I thought.

Nathan