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

REXML::Validation::RelaxNG

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

还没有人认领这个 Issue。

评估

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

调研方向

从 REXML::Validation::RelaxNG 开始,在 Ruby 2.7 和 IRB 中使用提供的 openmath2.rng 示例重现该失败。检查 relaxng.rb 第 89 行附近的代码,并确定 AnyName 常量为何不可用。当 schema 可以在没有此 NameError 的情况下传递给 RelaxNG,并且受支持的用法已得到记录时,即视为完成。

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

描述

Let openmath2.rng be the file https://www.openmath.org/standard/om20-2019-07-01/openmath2.rng

If I try to validate using that file, I get the following error:

$ gem list |grep rexml
rexml (default: 3.2.3)
$ ruby -v
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]
$ irb -v
irb 1.2.1 (2019-12-24)
$ irb
irb(main):001:0> require "rexml/validation/relaxng"
=> true
irb(main):002:0> schema = File.new( "openmath2.rng" )
irb(main):003:0> validator = REXML::Validation::RelaxNG.new( schema )
Traceback (most recent call last):
        6: from /usr/bin/irb:23:in `<main>'
        5: from /usr/bin/irb:23:in `load'
        4: from /usr/lib/ruby/gems/2.7.0/gems/irb-1.2.1/exe/irb:11:in `<top (required)>'
        3: from (irb):3
        2: from (irb):3:in `new'
        1: from /usr/lib/ruby/2.7.0/rexml/validation/relaxng.rb:89:in `initialize'
NameError (uninitialized constant REXML::Validation::RelaxNG::AnyName)
irb(main):004:0>

Apart the AnyName, how exactly is used REXML::Validation::RelaxNG ? I didn't find the documentation about it

主要语言
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 摘要。