ruby / ruby/rexml

REXML::Validation::RelaxNG

Open
#32 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
182
Forks
99
Avg merge
2d 23h
Merged PRs (30d)
8

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with REXML::Validation::RelaxNG and reproduce the failure using the supplied openmath2.rng example in Ruby 2.7 and IRB. Inspect relaxng.rb around line 89 and determine why the AnyName constant is unavailable. Done means the schema can be passed to RelaxNG without this NameError and the supported usage is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.