Rails/Ruby Verify nodes within XML with partial schemas



I'm trying to figure out if the possible scenario is doable, and what tools could be used to solve it in ruby/rails:


Lets say that I have an XML specifying something physical, like a chair. It would have nodes specifying what kind of material to use in which parts, what kind of nails or screws to use, etc.


Now I would like to have a schema (or a relax ng file or something else) defining restrictions or capabilities based on the XMLs.


Capabilities could be that I load one schema per potential manufacturer, defining e.g the materials they can supply in such a chair and the kind of nails. That would be partial schemas, not covering other aspects of the XML than what is relevant. The thought is that I could match the two together to get either a hit or a miss, ruling out non potential manufacturers.


Restrictions would basically be the same, but it might rule out a combination of a material in the chair itself and a certain metal in the nails. Or it could rule out the use of lead in the nails, etc. The method would be the same; match the XML against the restrictor and get a pass or a fail.


Anyone has any ideas of how this could be done and be what tools? I would like the creation of the schemas to be manageable by people without to much knowledge or training if possible.


Thanks in advance, Andreas


No comments:

Post a Comment