问题
I can replace a xml Attribute values using DTD Entity declaration using following methode
//in DTD
<!ENTITY varchar "VARCHAR(200)">
// In xml
<column name="attachment_url" type="&varchar;"/>
Now I want to replace a xml tag like
<column name="attachment_url" type="VARCHAR(200)"/>
using DTD Entity.
I try like
<!ENTITY full_coulumn "<column name="attachment_url" type="VARCHAR(200)"/>">
then i get an error
Unexpected column with text: <column name="attachment_url" type="VARCHAR(200)
"/>
Is it possible to replace entire xml tag with dtd Entity? How can i do that?
I am try to do this with liquibase xml file.
回答1:
Don't escape the markup in the entity declaration; by doing so, you signal to the processor that the entity's replacement text is a string of characters, not markup. What you want is:
<!ENTITY full_column "<column name='attachment_url'
type='VARCHAR(200)' />">
来源:https://stackoverflow.com/questions/14473460/how-to-replace-a-xml-tag-with-dtd-entity