error parsing changeLogParameter

Hello,
I’m testing liquibase-2.0RC2 and I have this problem whith this xml:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns=“http://www.liquibase.org/xml/ns/dbchangelog/1.9”
    xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
    xsi:schemaLocation=“http://www.liquibase.org/xml/ns/dbchangelog/1.9 http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd”>
   

the problem is this:

liquibase.exception.ChangeLogParseException: Error parsing line 6 column 51 of /liquibase/repository/update.xml: cvc-datatype-valid.1.2.1: ‘${CHANGELOGRELATIVE}’ is not a valid value for ‘boolean’.
at liquibase.parser.core.xml.XMLChangeLogSAXParser.parse(XMLChangeLogSAXParser.java:88)
at liquibase.Liquibase.update(Liquibase.java:96)

debugging the application, I’ve seen that the problem originates in method parse(Inputstream is) of the class org.apache.xerces.parsers.SAXParser returned by class org.apache.xerces.jaxp.SAXParserImpl: this method throws the reported SAXParserException:
org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.1: ‘${CHANGELOGRELATIVE}’ is not a valid value for ‘boolean’.

It seems that a validation occurs before liquibase ‘manage’ the ${…} changelog parameter…

Debugging the application I’ve seen this constructor:

public XMLChangeLogSAXParser() {
        saxParserFactory = SAXParserFactory.newInstance();

        if (System.getProperty(“java.vm.version”).startsWith(“1.4”)) {
            saxParserFactory.setValidating(false);
            saxParserFactory.setNamespaceAware(false);
        } else {
            saxParserFactory.setValidating(true);
            saxParserFactory.setNamespaceAware(true);
        }
}

I’m running the application with java 5: could it be the setValidating(true) and setNamespaceAware(true) invocation part of the problem?
Or there is any way to avoid the validation ?
Or I’m missing something?

regards,
  Duccio

That is the problem.  We are enabling validation on the parser because that does help make sure that it is following the defined schema before we bother trying to parse it.  I ran into the same problem and started to convert the code to convert the parameters before feeding it to the parser, but backed it out because it was pushing the work of replacing parameters into the parsers, and not in a shared post-parsing step (the code is designed to support multiple changelog file formats, not just XML).

It is probably worth revisiting it before 2.0 final, however.  I created http://liquibase.jira.com/browse/CORE-520

Nathan