Skip to Content
Schematron
book

Schematron

by Eric van der Vlist
March 2007
Intermediate to advanced
51 pages
1h 19m
English
O'Reilly Media, Inc.
Content preview from Schematron

Cookbook

Schematron is so simple that all of its basics fit in 20 pages! It is time to put this newfound knowledge into practice and get some real work done. The recipes that constitute this second part are derived from real world use cases. I hope that some of them will match cases that you have already encountered, or even better, that you need to solve right now. However, you will also run into cases that do not correspond to any of these recipes. If this happens, you should still be able to adapt the different techniques mentioned here. I invite you to go through these recipes, even if they solve issues that are different from those that you need to solve right now!

Avoiding Embedded Structures

In document-oriented applications such as XHTML, DocBook, TEI, DITA, and so on, it is often the case that some elements cannot be embedded within themselves. For instance, you probably want to forbid paragraphs that include a link within a link.

With a grammar-based schema language, the solution is to define two different content models: a content model for a paragraph and a content model for a link. These models are the same except that links are allowed in paragraphs but are forbidden within other links.

So far so good, but if you want to forbid bold within bold, you need to define four different content models: paragraph, link, bold, and bold in link, where both bold and link are forbidden. If you also want to forbid italic within italic, you need to define paragraph, link, bold, italic, ...

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

XSL-FO

XSL-FO

Dave Pawson
RELAX NG

RELAX NG

Eric van der Vlist
Exploring GPT-3

Exploring GPT-3

Steve Tingiris

Publisher Resources

ISBN: 9780596527716Errata