Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Incorrect DTD for wstcref-Files

未关闭 适合新手
#7,876 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1-3 小时
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
xml
领域
tooling

调研方向

从 issue 中链接的 platform/core.windows/src/org/netbeans/core/windows/resources/tc-ref2_2.dtd 开始,将其 previousMode 声明与生成的 tc-ref 版本 2.2 示例进行比较。使用 ant xmlvalidate 任务验证更正后的 DTD 和持久化示例文件;完成的标准是生成的文件通过验证,并且 DTD 按照 XML 建议进行解析。

由索引模型根据 Issue 内容生成。

描述

kind:bug needs:triage
Apache NetBeans version

Apache NetBeans 23

What happened

The DTD for wstcref-Files of version 2.2 (https://github.com/apache/netbeans/blob/master/platform/core.windows/src/org/netbeans/core/windows/resources/tc-ref2_2.dtd) contains two errors:

  1. The previousMode tag is required by the DTD, but not in the application runtime

  2. The previousMode attribute list is not formed well according to the W3C Recommendation (see https://www.w3.org/TR/2006/REC-xml11-20060816/): The name attribute has no so called Attribute Default (#REQUIRED, #IMPLIED or definition)

Language / Project Type / NetBeans Component

NetBeans Platform DTDs

How to reproduce

To reproduce the first problem mentioned above simple try to validate the persistance files generated by the NetBeans platform (can be found in the ProgramData folder), e.g.:

<?xml version="1.0" encoding="UTF-8"?>

<tc-ref version="2.2">
    <tc-id id="XXTopComponent" />
    <state opened="false" />
</tc-ref>

As you can see, even the generated files do not contain a previousMode-tag, cause it is only needed for docking/sliding operations.

The second problem occurs if you want to validate any wstcref-File of version 2.2 using the ant xmlvalidate task, cause it cannot parse the DTD referenced due to the wong formed attribute list of the previousMode tag.

Did this work correctly in an earlier version?

No / Don't know

Operating System

Windows 10

JDK

17

Apache NetBeans packaging

Apache NetBeans platform

Anything else

No response

Are you willing to submit a pull request?

Yes

主要语言
Java
星标
3.1k
派生
939
平均合并
5 天 3 小时
30 天内合并 PR
22

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/netbeans 的其他 Issue

查看 apache/netbeans 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。