XML object with parameters?

I want to get the resulting XML below but with modular XML parts

<createTable schemaName="mySchema" tableName="myTable">
     <column name="Id" type="int" />
</createTable>

      

I have embedded xml in DTD objects

myDTD file:

<!ENTITY createDefaultTable "
   <createTable schemaName="${schema}" tableName="${table}">
     <column name="Id" type="int" />
   </createTable>
   ">

      

myXML file:

 <!DOCTYPE defaults SYSTEM "myDTD">
 &createDefaultTable;

      

But my missing link is: how can I pass the $ {schema} and $ {table} parameters to be added to my object from the myXML file?

+3


source to share


1 answer


http://www.liquibase.org/documentation/changelog_parameters.html describes how change parameters are changed. They can be set with a tag <property>

at the beginning of your changelog, a system property, or in several different ways depending on how you call Liquibase.



If that doesn't work, you might run into an issue where using entities doesn't work with the logic of change options. I think the entity is also transparent to code using the XML parser, so I don't think this will be a problem, but let me know if it still doesn't work.

+1


source







All Articles