The method XML::RelaxNG.read_memory is intended to be a factory method for creating a new schema from the string contents of the schema file.
But ... this is exactly what XML::Schema.new does. And under the hood, libxml2 is still calling the same parsing code, so I would be surprised if it was any faster.
This duplication introduces debt to the codebase because it's another path we need to test (note: we're not doing a good job of this already), and the fact that we've begun to have to add workarounds for libxml2 misbehavior (see #1985) and it's not clear if we need to add it to both code paths or what.
Anyway, here's what I want:
- benchmark the two paths, make sure there isn't a performance reason to keep
read_memory around
- remove read_memory and make it an alias for
XML::Schema.new
The method
XML::RelaxNG.read_memoryis intended to be a factory method for creating a new schema from the string contents of the schema file.But ... this is exactly what
XML::Schema.newdoes. And under the hood, libxml2 is still calling the same parsing code, so I would be surprised if it was any faster.This duplication introduces debt to the codebase because it's another path we need to test (note: we're not doing a good job of this already), and the fact that we've begun to have to add workarounds for libxml2 misbehavior (see #1985) and it's not clear if we need to add it to both code paths or what.
Anyway, here's what I want:
read_memoryaroundXML::Schema.new