如何用DTD实体替换xml标签 [英] How to replace a xml tag with DTD entity

查看:73
本文介绍了如何用DTD实体替换xml标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用以下方法使用DTD Entity声明替换xml属性值

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;"/>

现在,我想替换

<column name="attachment_url" type="VARCHAR(200)"/>

使用DTD实体.

我尝试 <!ENTITY full_coulumn "&lt;column name=&quot;attachment_url&quot; type=&quot;VARCHAR(200)&quot;/&gt;">

然后我得到一个错误

 Unexpected column with text: <column name="attachment_url" type="VARCHAR(200)
"/>

是否可以用dtd实体替换整个xml标签?我怎样才能做到这一点?

Is it possible to replace entire xml tag with dtd Entity? How can i do that?

我试图用liquibase xml文件来做到这一点.

I am try to do this with liquibase xml file.

推荐答案

不要在实体声明中转义标记;这样,您就向处理器发出信号,即实体的替换文本是一个字符串字符串,而不是标记.您想要的是:

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)' />">

这篇关于如何用DTD实体替换xml标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆