XML验证和自动完成在Eclipse [英] XML validation and auto-complete in Eclipse

查看:338
本文介绍了XML验证和自动完成在Eclipse的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android SDK中,当我编辑的android布局的xml文件,它可以做验证和自动完成。这是如何工作的?

In android SDK, when I editing an android layout xml file, it can do validation and auto-complete. How does this work?

我怎样才能使日食验证并自动完成与我自己定义的XML格式?

How can I make eclipse validate and auto-complete with my own defined xml format?

推荐答案

Eclipse可以用于编辑和验证XML文件。我在Eclipse中的J2EE开发人员经常使用它。

Eclipse can be used to edit and validate XML files. I use it quite often in my Eclipse for J2EE Developers.

首先,你必须创建pferably $ P $ XSD文件来定义XML结构。其次,你必须创建XML文件,并在其定义所在的验证可以找到XSD文件。

First, you have to create preferably an XSD file to define the XML structure. Second, you have to create the XML file and define in it where the validator can find the XSD file.

第二点,有更多的解决方案。要么你指定参考直接在XML文件中的XSD文件( noNamespaceSchemaLocation ),或者只指定了命名空间和系统ID INT XML文件,并您设置的实际路径在Eclipse IDE中的XSD文件(preferences-> XML-> XML目录,在这里你可以映射系统ID来XSD URL)。

The second point has more solutions. Either you specify the reference to the XSD file directly in the XML file (noNamespaceSchemaLocation) or you specify only the namespace and system-id int the XML file and you set the actual path to the XSD file in the Eclipse IDE (Preferences->XML->XML Catalog, here you can map system-id to XSD URL).

然后,只需点击用鼠标右键XML文件,并选择验证的选择。

Then just click the XML file with the right mouse button and select the Validate choice.

这篇关于XML验证和自动完成在Eclipse的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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