Eclipse 中的 XML 目录无法正常工作
我工作的地方没有任何互联网连接。我们仍然希望在编辑 xml 文件时进行验证和代码完成。我已尝试此处的说明 http://www.helmers.nu/?p=276
但是,我尝试了说明,重新启动 Eclipse,重新加载依赖项。我仍然无法获得任何代码完成或验证。有人能指出我正确的方向吗?我已经尝试过 Eclipse Galileo 和 Helios。
我的 Catalog.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<uri name="http://www.liquibase.org/xml/ns/dbchangelog/1.9" uri="file:///C:/dev/XMLSchemaDefinition/dbchangelog-1.9.xsd"/>
</catalog>
我的 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">
</databaseChangeLog>
Where I work we do not have any internet connection. We still want to have validation and code completion when editing xml files. I have tried the instructions here http://www.helmers.nu/?p=276
However, I try the instructions, restarts eclipse, do reload dependencies. I still cannot get any code completion nor validation. Can anyone point me in the right direction? I have tried both with Eclipse Galileo and Helios.
My catalog.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<uri name="http://www.liquibase.org/xml/ns/dbchangelog/1.9" uri="file:///C:/dev/XMLSchemaDefinition/dbchangelog-1.9.xsd"/>
</catalog>
My xml-file:
<?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">
</databaseChangeLog>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在目录中,您将“http://www.liquibase.org/xml/ns/dbchangelog/1.9”映射到本地 URI,但在 XML 文件中,您说架构位置是“http://www.liquibase” .org/xml/ns/dbchangelog/dbchangelog-1.9.xsd”。
Eclipse 尝试通过 XML 目录解析“http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd”,但没有找到它跳转的网络条目。
我建议在目录中添加另一个条目,将公共架构位置 URI 映射到同一个本地文件。
In your catalog, you map "http://www.liquibase.org/xml/ns/dbchangelog/1.9" to a local URI, yet in your XML file you say that the schema location is "http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd".
Eclipse tries to resolve "http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd" via XML Catalog and doesn't find an entry so on to the net it hops.
I would recommend adding another entry to your catalog that maps your public schema location URI to the same local file.