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
3
votes
1 answer

relaxng: invalid schema definition?

I'm trying to write a schema for some XML documents using RELAX-NG, and when I use it with jing, I get an error message I don't understand: C:\tmp\xml>java -jar jing.jar -c list-test2.rnc list-test.xml C:\tmp\xml\list-test2.rnc:6:10: error: repeat…
Jason S
  • 184,598
  • 164
  • 608
  • 970
3
votes
3 answers

Is there an application that can help someone create an XML document based on the Relax NG schema?

I've spent a bit of time creating a Relax NG schema for use within our team to validate XML documents we use for exchanging information. The schema is not complicated, but it is reasonably large. I am wondering if there exists a tool that can read…
davidA
  • 12,528
  • 9
  • 64
  • 96
3
votes
3 answers

RelaxNG (rnc) schema to extend XHTML

I would like to edit XHTML files using Emacs' nxml-mode which can use rnc schemas for on the fly validation. This is all built in to newer Emacs versions. However, my XHTML files contain elements from another schema. So tags are valid, but…
relaaax
3
votes
1 answer

XSD sequence shows as ambiguous

I have an XSD which was transformed from a RELAX NG schema with a few errors I am trying to fix. The big issue I have it with the following
Tim C
  • 1,934
  • 12
  • 25
3
votes
1 answer

command line validator supporting relax ng Schemas with embedded iso Schematron

Are there any command line-validators that can cope with relax ng-Schemas with embedded iso schematron? I've got a couple of relax ng-schemas with embedded iso-schematron rules which I have to be able to validate on the command line. As it seems,…
Schweutsch
  • 31
  • 4
3
votes
1 answer

How to link an xml document to a Relax NG schema using the xml-model tag?

I wish to link an xml document to its Relax NG description document, using the xml-model tag as specified in its W3C draft. Do you have a full example to show how…
Eric Lavoie
  • 5,121
  • 3
  • 32
  • 49
3
votes
2 answers

Jing RelaxNG validator and custom datatype library from java code

After reading this I've been trying to implement a custom datatype to be used by a RelaxNG XML validator (Jing). I've successfully ran the example implementation which is provided by Jing (they call it datatype-sample) through command line but I…
predi
  • 5,528
  • 32
  • 60
2
votes
1 answer

Querying a RelaxNG schema (xml syntax) in java, preferably using Jing

I am trying to find a way to query a RNG schema while avoiding reinvention of the wheel, in order to answer basic questions such as: what elements are valid children of an XML instance element, what can/must be it's attributes and so on. A post here…
predi
  • 5,528
  • 32
  • 60
2
votes
1 answer

Referencing specific element(s) in a RelaxNG schema with externalRef

So I have one RelaxNG schema that references another: other.rng:
lambshaanxy
  • 22,552
  • 10
  • 68
  • 92
2
votes
1 answer

Is it possible to force the use of CDATA via RelaxNG?

I'm looking for a way to use RelaxNG to require an element in an XML document to be populated with CDATA. I don't see it listed in the Guidelines for using W3C XML Schema Datatypes with RELAX NG or the datatype library. Is it possible?
Alan W. Smith
  • 24,647
  • 4
  • 70
  • 96
2
votes
2 answers

Validating XHTML5 in PHP?

Background I have made the decision to serve my website as application/xhtml+xml to anyone who will accept it. I understand that there are consequences, which consequences I'm willing to accept. Problem I'm trying to validate XHTML5 in PHP. That…
Levi Morrison
  • 19,116
  • 7
  • 65
  • 85
2
votes
1 answer

Relaxer or JAXB for XML->Object Model?

I would like generate an AST from my XML-definition, to be used for code generation later on. The XML schema is written in Relax NG, since it seemed like a neater and more modern than XSD and DTD (loose assumption). I especially fancy the compact…
Sebastian Ganslandt
  • 965
  • 2
  • 13
  • 26
2
votes
1 answer

How to validate xml document against relaxNG schema in libxml++

I'm rather new to parsing xml in c++ and to xml in general. I'm trying to parse my document with SAXParser from libxml++ library, however, I would also like it to validate my document against a relaxNG schema. I've found that libxml2, which is…
2
votes
1 answer

Why does Jing not allow a colon (":") in an id attribute?

I've been banging my head against xsd:ID not allowing a colon (":") in an id attribute. I first noticed this when using James Clark's nxml-mode in Emacs as it validated an XHTML file I was working with. I then ran the XHTML file against the RNG…
Zach Young
  • 10,137
  • 4
  • 32
  • 53
2
votes
1 answer

RelaxNG - *any* attribute?

Is there a way to define an any name attribute? I'm validating code where users can and do apply their own attributes for tags and the like, which don't impact my project.
Mark
  • 21
  • 1
1 2
3
11 12