Skip to Content
RELAX NG
book

RELAX NG

by Eric van der Vlist
December 2003
Intermediate to advanced
506 pages
12h 26m
English
O'Reilly Media, Inc.
Content preview from RELAX NG

Other Options

What if you really need a feature that’s missing in RELAX NG to create building blocks? What if, for instance, you need to reuse a name class or a datatype parameter defined once and only once in multiple locations of a schema?

If this were an absolute requirement, which isn’t often the case, you would have to use non-RELAX NG tools or features. RELAX NG has an advantage over DTDs or W3C XML Schema in that there are two possible syntaxes, leaving the option to work with either XML mechanisms with the XML syntax or plaintext tools with the compact syntax.

There is no limit to the tools to produce our result, but let’s set up a possible use case and some examples of implementations.

A Possible Use Case

Let’s just say you want to specify the set of possible characters in your documents and that you want to implement this rule in your RELAX NG schemas. The pattern you might have in mind to perform this restriction could be the one that’s an example in Chapter 9. It’s not very complex, but not very simple either:

 pattern = "[\p{IsBasicLatin}\p{IsLatin-1Supplement}]*"

Of course, you might want to easily update it if you had to. You wouldn’t want to have to copy it in each datatype definition, and you might want to use this pattern in different contexts over different datatypes and eventually combine it with other parameters.

XML Tools

XML parsed entities (internal or external and in the internal DTD or in an external DTD) may be used in the above case. Using internal entities ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

How to Develop a Great Digital Strategy

How to Develop a Great Digital Strategy

Jeanne W. Ross, Cynthia M. Beath, Ina M. Sebastian
Broadband Optical Access Networks

Broadband Optical Access Networks

Leonid G. Kazovsky, Ning Cheng, Wei-Tao Shaw, David Gutierrez, Shing-Wa Wong
The Hidden Cost of AI-Assisted Creativity

The Hidden Cost of AI-Assisted Creativity

Léonard Boussioux, Anil Doshi, Oliver Hauser, Kartik Hosanagar
XML Hacks

XML Hacks

Michael Fitzgerald

Publisher Resources

ISBN: 0596004214Errata Page