Questions tagged [relaxng-compact]

RELAX NG compact syntax is a non-XML format inspired by extended Backus-Naur form and regular expressions, designed so that it can be unambiguously translated to its XML counterpart, and back again, with one-to-one correspondence in structure and meaning, in much the same way that Simple Outline XML (SOX) relates to XML. It shares many features with the syntax of DTDs.

In computing, RELAX NG (REgular LAnguage for XML Next Generation) is a schema language for XML, based on Murata Makoto's RELAX and James Clark's TREX.
A RELAX NG schema specifies a pattern for the structure and content of an XML document.
A RELAX NG schema is itself an XML document; however, RELAX NG also offers a popular compact, non-XML syntax.
Compared to other popular schema languages, RELAX NG is relatively simple.
It was defined by a committee specification of the OASIS RELAX NG technical committee in 2001 and 2002, and also by part two of the international standard ISO/IEC 19757: Document Schema Definition Languages (DSDL).
ISO/IEC 19757-2 was developed by ISO/IEC JTC1/SC34 (ISO/IEC Joint Technical Committee 1, Subcommittee 34 - Document description and processing languages) and published in its first version in 2003.

Suppose we want to define an extremely simple markup scheme for a book: a book is defined as a sequence of one or more pages; each page contains text only.
Here is the compact form of the above scenario:

element book
{
    element page { text }+
}

With named patterns, this can be flattened to:

start = element book { page+ }
page = element page { text }

A compact RELAX NG parser will treat these two as the same pattern.

See also:

22 questions
2
votes
1 answer

Generating XSD from RelaxNG while keeping root-element restriction

I want to convert the following schema from RNC/RNG to W3C XSD. default namespace = "" namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" namespace rng = "http://relaxng.org/ns/structure/1.0" start = starting_risk starting_risk = …
Qeebrato
  • 131
  • 7
2
votes
1 answer

convert relaxng file that include reference to another relax ng file to xsd

I am going to convert relaxng compact file to xsd. So the command to user here would be: java -jar tang.jar test.rng newtest.xsd My question here is as follow: I have several rnc file in which some of them have the reference to another rnc file.…
kiarash
  • 23
  • 4
2
votes
1 answer

Express a recursive reference in a set of recurring ordered elements

I'm trying to write a RelaxNG schema that has the following rules: A line element can contain zero or more a and b elements. Every a element must have a corresponding b element and vice-versa. a elements must always precede their matching b…
user6213122
1
vote
0 answers

What is precedence order in relaxng compact notation?

What is the order of precedence of the *, ?, | and , operators in relaxng compact notation? For example: start = element A { B | C , D * } Which of these, is the above equivalent to? start = element A { (( B | C ) , D) * } start = element A { (B |…
Andrew Tomazos
  • 66,139
  • 40
  • 186
  • 319
1
vote
1 answer

How to add new meta-property values in rdfa.rnc

In the RelaxNG compact-syntax schema here: https://github.com/validator/validator/blob/master/schema/html5/rdfa.rnc#L51 …I would like to edit with some fixed rdfa attribute 'property' value in meta element. I defined two values…
VSe
  • 919
  • 2
  • 13
  • 29
1
vote
1 answer

Need help grasping RelaxngValidatingReader in Commons.Xml.Relaxng

Environment: RelaxngValidatingReader .Net 2.0 Framework I can't seem to get the validator to equal false, no matter how much I change the xml around. Am I missing some concept…
Rod
  • 14,529
  • 31
  • 118
  • 230
1
vote
1 answer

What if a sub element is used by two other independent elements when using RELAX NG Compact?

I am using RELAX NG Compact and have run across a case where a sub-element is being used by two independent parent elements. How can I resolve this? Use case 1 Use case 2
Rod
  • 14,529
  • 31
  • 118
  • 230
1
vote
0 answers

Should I rewrite the table or can I run multiple iterators on this? XQuery

Pseudo table in relax ng compact: element books element book element publisher element publisherinfo The table (but in norwegian): datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes" element bøker{ …
Peebl
  • 211
  • 3
  • 13
1
vote
1 answer

RELAX NG conditional datatype based on other element

My goal is to have a RELAX NG compact schema which enforces that an element's datatype matches that of the parent element's datatype. I currently have the following schema: start = Tickmarks Tickmarks = element tickmarks { attribute from {…
Paul
  • 5,514
  • 2
  • 29
  • 38
0
votes
1 answer

Mixing data(types) and elements in Relax NG

I am trying to define a Relax NG compact syntax model for the following content: -132.976733 56.437924 -132.735747 56.459832 -132.631685 56.421493 -132.664547 56.273616 -132.878148 56.240754…
0
votes
1 answer

RelaxNG (compact) validation

I have two RelaxNG file (fileA.rnc and fileB.rnc) within the Database. fileA.rnc is the main schema which has included fileB.rnc with syntax: include "fileB.rnc" I want to validate my XML input with fileA.rnc schema at the time of ingestion with…
Navin Rawat
  • 3,208
  • 1
  • 19
  • 31
0
votes
0 answers

Interleave In RNC

I have source with three p with different attribute values, I tried to make arbitrary order of elements along with one mandatory element p class='paragraph1'. That is any number of paragraph1, paragraph2 and pharagraph3 in any order but there must…
VSe
  • 919
  • 2
  • 13
  • 29
0
votes
1 answer

HTML5 RNC- datatype library "http://whattf.org/datatype-draft" not recognized

I tried to validate my HTML5 document against the Nu RNC set available in github.com/validator/validator/tree/master/schema/html using jing, I ended up with "datatype library "http://whattf.org/datatype-draft not recognized" error. I am not sure…
VSe
  • 919
  • 2
  • 13
  • 29
0
votes
1 answer

Control attribute values order in RelaxNG

Is it possible to control the order of the attribute values in Relax NG? which can be achieved using xs:assert in schema? XML:

title

subtitle

para text 1

VSe
  • 919
  • 2
  • 13
  • 29
0
votes
2 answers

How to ignore html in an xml element when validating with relaxng compact

How can I have a pattern that ignores html within an element rather than the validator trying to validate it this is some text with the odd bit of html

and unclosed tags This isn't valid but I…

Adrian Cornish
  • 23,227
  • 13
  • 61
  • 77
1
2