Questions tagged [relaxng]

RELAX NG (ISO/IEC 19757-2) is an International Standard schema language for XML. A RELAX NG schema specifies a grammar that a validator can apply to XML documents to determine whether or not they are schema-valid.

RELAX NG is a schema language for XML. A RELAX NG schema specifies a grammar that a validator can apply to XML documents to determine whether or not they are valid.

RELAX NG was invented by James Clark and MURATA Makoto and standardized first at OASIS and subsequently in ISO/IEC JTC 1 as an International Standard, ISO/IEC 19757-2 (available here). It is formally expressed with a strong mathematical basis.

Some features of RELAX NG:

  • Schemas can be expressed using either XML, or a non-XML "compact syntax".

  • Support for pluggable datatype libraries. (Most validators come with support for the datatypes defined by W3C XML Schema.)

  • Ability to specify the start (root) elements for documents.

  • Slightly more sophisticated grammar modelling that that permitted by XML DTDs or W3C XML Schema.

Although enjoying less market share than W3C XML Schema, RELAX NG is popular among markup experts and is used as the schema language of other standards such as ODF, MathML and EPUB.

RELAX NG schemas can be programmatically converted to XML DTDs or W3C XML Schemas using James Clark's free and open source trang utility.

References:

173 questions
27
votes
5 answers

RelaxNG vs XML Schema

I have a project where I'm using RelaxNG (jing) to validate xml. I like the syntax for RelaxNG, but most of the tools that I have work with XML schema (actually, I don't think I have a tool that does, other than jing). Am I making a design and…
jmq
  • 10,110
  • 16
  • 58
  • 71
17
votes
5 answers

XML Schema Validation with RelaxNG

Which XML validation tools can you recommend for both performance and accuracy, each of which is a critical issue on our system? We have the following requirements: It is not xmllint (see below) Supports RelaxNG Can easily integrate with Perl…
Ovid
  • 11,580
  • 9
  • 46
  • 76
15
votes
5 answers

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

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…
Avi Flax
  • 50,872
  • 9
  • 47
  • 64
9
votes
2 answers

Is there a Relaxer for .NET? Is Relaxer alive? Is RelaxNG viable?

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…
Cheeso
  • 189,189
  • 101
  • 473
  • 713
9
votes
2 answers

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

How do I validate XML document via compact RELAX NG schema in Python?
esamatti
  • 18,293
  • 11
  • 75
  • 82
8
votes
4 answers

Schema-sensitive editing in emacs, based on W3C XML Schema? (not RNG)

I just learned, here, about nxml-mode, which, according to the README, is a major mode for GNU Emacs for editing XML documents. It supports editing well-formed XML documents and also provides schema-sensitive editing of XML documents using…
Cheeso
  • 189,189
  • 101
  • 473
  • 713
8
votes
1 answer

How to check that attributes are unique with RelaxNG?

With RelaxNG, can I check whether or not the value of an attribute is unique within an enclosing element? For example, this castle should validate:
Wander Nauta
  • 18,832
  • 1
  • 45
  • 62
8
votes
3 answers

How to convert an XML schema (XSD) to Relax NG?

The Relax NG homepage lists the Sun RELAX NG Converter which apparently is able to convert an XSD file to a relaxng one - but the link is dead and a blog entry about secondary sources seems to be outdated as well. I am not interested in a web-based…
maxschlepzig
  • 35,645
  • 14
  • 145
  • 182
7
votes
2 answers

How do I validate XML via RELAX NG in Ruby?

The REXML module appears to have support for RELAX NG validation, but the docs don't have any real information on using the validation portion of the framework. How would you validate an XML document with a RELAX NG schema? A code snippet would be…
cdleary
  • 69,512
  • 53
  • 163
  • 191
7
votes
1 answer

Can I convert RELAX NG to the XSD?

See subject: and if I can, my second question is, How? I tried to use the trang Java library and nothing happened :(
jitm
  • 2,569
  • 10
  • 40
  • 55
7
votes
1 answer

RELAX NG C++ Code Generator?

Are there any open source RELAX NG C++ code generator? Thanks.
Alon Gubkin
  • 56,458
  • 54
  • 195
  • 288
7
votes
2 answers

How can I use other/more modern schema validation with .Net?

I'm trying to do some work with C# and XML in a cross-platform app (most development is in MonoDevelop on Linux, but most users will end up using the WinForms front-end that I make in Visual Studio). Mono is behaving as I'd expect, but .Net isn't…
IBBoard
  • 909
  • 4
  • 16
6
votes
2 answers

Generate object model out of RelaxNG schema with RNGOM - how to start?

I want to generate an object model out of an RelaxNG Schema. Therefore I want to use the RNGOM Object Model/Parser (mainly because I could not find any alternative - although I don't even care about the language the parser is written in/generates).…
Wolkenarchitekt
  • 20,170
  • 29
  • 111
  • 174
6
votes
2 answers

Validating xml against relax ng in ANSI C

Is it possible to validate an xml file against a Relax NG schema in ANSI C? I have come across this library called libxml2 but all help I could get from it is with respect to how to parse an xml file. Please help. And if it can be done, what are…
Gyandeep
  • 63
  • 2
6
votes
2 answers

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

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…
James
  • 88
  • 3
1
2 3
11 12