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

RELAX NG Validator fails to handle XML documents with XML declaration

未关闭
#241 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

@Shaisolaris 已经在做这个了。

开始于 2026年10月12日。

  • #376 来自 @Shaisolaris —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
ruby
领域
backend

调研方向

从 test/test_validation_rng.rb 中提议的测试用例开始,并运行 RELAX NG 验证测试。确认包含该声明的 XML 文档能够根据所提供的语法成功通过验证;issue 中未指定实现路径。

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

描述

The RELAX NG validator currently does not handle XML documents with an XML declaration, such as <?xml version="1.0" encoding="UTF-8"?>.

As a first step to address this issue, I suggest adding the following test case to test/test_validation_rng.rb. This test case checks that the validator can successfully validate an XML document with a declaration. I haven't yet developed an implementation solution, but this test will help ensure that we cover this scenario:

def test_document_with_declaration
  rng = <<-XML
<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
  <start>
    <element name="root"/>
  </start>
</grammar>
XML
  validator = REXML::Validation::RelaxNG.new(rng)

  source = <<-XML
<?xml version="1.0" encoding="UTF-8"?>
<root/>
XML

  no_error(validator, source)
end
主要语言
Ruby
星标
181
派生
105
平均合并
11 小时 3 分钟
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

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

ruby/rexml 的其他 Issue

查看 ruby/rexml 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 发到你的邮箱

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