New draft of Document Schema Renaming Language out for review

by Rick Jelliffe

Martin Bryan has released the latest draft (second final committee draft) for ISO DSRL. He has an open source implementation available too: like some of the other parts of ISO DSDL (Schematron and DTLL) it is designed to be implementable on top of XSLT (XSLT2 in this case) however of course it can be implemented in Java or .NET or C++ directly too: DSRL is certainly suitable for building into a validator as a pre-processor, in a way a little analogous to OASIS XML Catalogs.

DSRL is a real missing piece in the puzzle: it provides a simple tool for remapping names in documents. This allows a more declarative approach than just using XSLT, and makes the task of mapping suitable for non-programmers. It fits into the schema ecosystem because it lets you rename the names in your document to suit that of a standard schema. It is only about 18 pages long, including examples, and easy to read.

We are used to thinking of things the other way around: we expect that allowing variability of element names should be an issue of type derivation if we are operating in the XSD mentality for example. (Actually, of course, the XSD mentality is a figment of the imagination, like all mentalities, and is just an extreme reduction which few people would really hold!)

But consider the case of where there is a schema made with English-derived names, but the users are going to be Chinese who don't speak or read English. (The days when "educated" entailed "fluent in English" are long gone, just as the days when "educated" entailed "fluent in French".) It would be much more straightforward, for localization, to have a simple mapping of names, than to ensure that the initial schema was rewritten so that every element was actually a substitution group.

More than this: we are used to saying that "syntax is easy; semantics is hard". But even syntax is not easy without straightforward tools. Just last week I was working with an example of a company that was considering using an standard external schema, but wanted to use its own terms for things where they existed. Exactly a job for DSRL!

DSRL allows these kinds of mapping, and I think that like ISO Schematron and ISO NVRL it will progressively become part of the schema environment for standards, especially outside the English-speaking world, and especially because XML is the structured format "for the rest of us". Even the most tragic XML Schema devotee realizes that there needs to be some limits to XSDs scope, and DRSL (and Schematron and NVRL) have a good fit even with XSD. (Of course, we designed them around RELAX NG, but standards are pragmatics not religions.)

DSRL allows the following remappings (organized into a series of maps that typically relate to an output namespace):

  • Element names (in an Xpath context)

  • Attribute names

  • Element simple values

  • Attribute values

  • Default values for elements or attributes (including the subelement after which the content may go, in the case of an element: mixed content is not ignored!)

  • Processing instruction targets

  • Entity names (e.g. for undeclared entity references)

In addition, a new XML-based syntax for defining entities is given. (When implemented on a systems (such a DOM) where undeclared entity references are maintained, the implementation is straightforward. When implemented on systems that would not allow this, then implementation would involve converting the XML form of declaration into <!ENTITY declarations and inserting them into the local subset of the prolog. Its just rewriting.)

ISO DSDL is a multipart standard that we have been progressing in a slow-and-steady fashion through ISO SC34 for the last few years. It is really what the SC34 WG1 working group does: ODF and OOXML are intrusions, part welcome but part unwelcome. (In fact, dissatisfaction at WG1 and SC34 with the fast-tracked standards is at a crisis point now and has been escalated to discussion at the JTC1 meeting in Australia last week: it probably deserves a blog item by itself, because it may introduce a wildcard to the OOXML BRM: what fun!)

If you have comments on ISO DSRL, send them in to your local national standard committee so that they can be raised during the discussions in Kyoto for SC34 WG1 in December. Contact your local standards body and ask them how to contact the chair of the local "ISO/IEC JTC1 SC34 equivalent" committee. Why not get involved yourself? Standards really are a chance for good technical people to influence technology in ways that reflect their needs, especially in medium-size countries where you might otherwise feel dwarfed by American technocratic power. If your business relies on XML and document standards, why not invest some time back? You may not think yourself brilliant enough or articulate enough or self-promoting enough or rich enough to get involved, but a lot of the real work is just quiet technical review and discussion, that can be done in your own home and in small friendly local committees, getting to know procedures and approaches, and by email.


Rick Jelliffe
2008-05-19 20:48:01
I had a question offline asking where the implementation was.

At, in the section on DSRL is a link "Materials to accompany above tutorial (ZIP file)"

Inside this is a file called TransformDSRLMaps.xsl which is the engine for converting from a DSRL file to an XSLT 2 script (with an entity file). This XSLT file in turn is run against the input file to do the mapping, like Schematron.