问题描述
我想获得NetBeans的代码完成和XML验证,这些NetBeans可以访问XML文档中引用的模式.不幸的是,我需要在脱机位置(与Internet完全断开连接)中使用NetBeans,这意味着NetBeans无法下载引用的.xsd文件.但是,我所有的xsd文件都保存在本地.
I would like to have the code completion and XML validation that comes from NetBeans having access to the schemas referenced in XML documents. Unfortunately I need to use NetBeans in an offline (completely disconnected from the Internet) location, meaning NetBeans fails in downloading the referenced .xsd files. However, I have all of the xsd files saved locally.
如何使NetBeans知道像xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"
这样的东西应该真正映射到C:/Schemas/beans/spring-beans-2.5.xsd
?
How can I make NetBeans know that something like xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"
should really map to C:/Schemas/beans/spring-beans-2.5.xsd
?
NetBeans 6.5有一些方法可以拥有模式的XML目录,但是目前尚不清楚它是如何工作的.我知道选项之一是 OASIS 格式...也许这是关键
NetBeans 6.5 has some means of having an XML catalog of schemas, but it's unclear how this works. I know one of the options is for OASIS format... perhaps this is the key
推荐答案
我在NetBeans 6.9中执行以下操作...
I do the following in NetBeans 6.9...
-
选择"DTD和XML模式"在工具"菜单中.
Select the 'DTDs and XML Schemas'item from the Tools menu.
将打开一个对话框.
在左侧列表中滚动直到项目用户目录"[读写]可见.
Scroll through the list on the leftuntil the item 'User catalog[read-write] is visible.
选择该项目.
按下标题为添加本地"的按钮DTD或架构...'
Press the button titled 'Add LocalDTD or Schema...'
将打开另一个对话框,以定义网址与对本地文件的引用.
Another dialog opens to define aconnection between a URL with areference to a local file.
这篇关于NetBeans:如何提供离线XML模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!