【发布时间】:2013-01-24 13:14:08
【问题描述】:
我正在使用 JAXB 生成代码。现在我正在尝试将 XJC 命名空间添加到自定义 bindings.xjb 文件中,但 IntelliJ Idea 12 找不到命名空间。 xmlns:xjc="..." 行标记为红色,当我尝试使用“获取外部资源”功能时,它告诉我 No XML at the location: http://java.sun.com/xml/ns/jaxb/xjc。在哪里可以找到 xjc 命名空间的 xsd 文件以激活内容辅助?
这是我的 .xjb 文件中的定义:
<jxb:bindings version="2.0"
xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd">
【问题讨论】:
-
你试过
JAXB_ROOT\lib\jaxb-xjc.src.zip\com\sun\tools\xjc\reader\xmlschema\bindinfo\xjc.xsd文件吗?您可以将其解包并映射到Settings| 中的命名空间。Schemas and DTDs. -
好主意!将您的评论格式化为答案,我会将其标记为正确。
标签: jaxb intellij-idea xsd xml-namespaces xjc