relaxng

Can relaxng specify an unordered set of elements with the same name, but different attributes?

泄露秘密 提交于 2019-12-01 03:42:36
问题 Im working to automate the testing of an API which takes and returns XML, so I want to translate the documented return data of the API into schema as much as possible. I chose RelaxNG for this task based on ease of use and learning. Before I throw in all the info, here's the question: Is it possible to describe "unordered set of elements, with the same name but different attributes" ? Here is a sample object for what I'm having trouble describing: <item> <id>d395136e-d060-4a6e-887c

How do I validate XML document using compact RELAX NG schema in Python?

旧巷老猫 提交于 2019-12-01 00:48:06
问题 How do I validate XML document via compact RELAX NG schema in Python? 回答1: How about using lxml? From the docs: >>> f = StringIO('''\ ... <element name="a" xmlns="http://relaxng.org/ns/structure/1.0"> ... <zeroOrMore> ... <element name="b"> ... <text /> ... </element> ... </zeroOrMore> ... </element> ... ''') >>> relaxng_doc = etree.parse(f) >>> relaxng = etree.RelaxNG(relaxng_doc) >>> valid = StringIO('<a><b></b></a>') >>> doc = etree.parse(valid) >>> relaxng.validate(doc) True >>> invalid =

Is there a Relaxer for .NET? Is Relaxer alive? Is RelaxNG viable? [closed]

对着背影说爱祢 提交于 2019-11-30 19:02:58
I read about Relaxer, the thing that compiles .RNG to Java classes. BBut the website, http://www.relaxer.org/ , is dead. Q1: Is Relaxer alive? Is it real, does it work? Is it reasonable to generate Java classes from .RNG? Q2: Is there a Relaxer for .NET? Is there a tool that generates C# classes from RelaxNG schema? Q3: Is there a Relaxer for Javascript? AND, finally Q4: Is RelaxNG alive? Is it viable? Relevant and useful in the REST/JSON world? Are people still using it or is it going to fade, a good idea that has been dropped? I know that is subjective, but I'd like to know your assessment.

How to validate an XML document using a RELAX NG schema and JAXP?

有些话、适合烂在心里 提交于 2019-11-30 08:34:52
I would like to validate XML documents using RELAX NG schemata, and I would like to use the JAXP validation API . From Googling around, it appeared that I could use Jing and the ISO RELAX JARV to JAXP Bridge . Unfortunately, after adding both to my classpath, I can't get it to work. SchemaFactory is just throwing an IllegalArgumentException as soon as it tries to instantiate a factory — I looked inside SchemaFactory , apparently SchemaFactoryFinder is returning a null result. So I'd appreciate answers to either question: How can I make this work with Jing and this bridge? Is there a better