so…Norm's musings. Make of them what you will.https://so.nwalsh.com/feed/fulltext.xml2024-02-09T07:21:44.684ZNorman WalshDocBook v5.2 is an OASIS Standard!https://so.nwalsh.com/2024/02/09-docbook2024-02-09T07:21:44Z2024-02-09T07:21:44Z

It’s official, we made it.

Volume 8, Issue 7; 09 Feb 2024

It’s official, we made it.

OASIS Open has officially announced that Docbook version 5.2 passed the “call for consent” and is an OASIS Standard. There’s a bit of paperwork to do, of course, to produce the OASIS Standard branded schemas and such, but we’re technically finished.

Version 5.2 isn’t very different from 5.1, really, but 5.1 became an OASIS Standard in 2016, so it’s been a while. If you’re curious, the changes from 5.1 are:

  • New synopsis elements for programming languages: enumsynopsis, macrosynopsis, packagesynopsis, typedefsynopsis, and unionsynopsis.
  • New danger admonition element.
  • New formalgroup element to support subfigures, etc.
  • New transclusion fixup attributes.
  • New class attribute on section elements to support legal sections.
  • New meta element added to info.
  • XInclude-enabled schema versions of assembly.rng and dbits.rng.

My heartiest congratulations to Bob Stayton for chairing the Technical Committee through the sometimes frustrating standardization process, to the rest of the Technical Committee for all their efforts, and the broader DocBook community!

DocBook xslTNG Stylesheets version 2.2.0https://so.nwalsh.com/2024/02/03-DocBook-xslTNG2024-02-03T16:10:01Z2024-02-03T16:10:01Z

Several new features and bug fixes for your DocBook transformation needs!

Volume 8, Issue 6; 03 Feb 2024

Several new features and bug fixes for your DocBook transformation needs!

The last release was apparently in August, so it’s been a while. I won’t repeat the whole change log here, I’ll just point out some of the more interesting things.

  • Support for automatic glossaries and bibliographies. That is, you can easily store your glossary and bibliography entries in a separate file and automatically pull in the relevant entries for a given document. There’s a bit of Schematron as well, to aid in authoring them.
  • The options for cross-reference styles are more flexible.
  • The extension functions that handle finding the intrinsic size of images now support non-integer lengths in SVG and units with dimensions.
  • The bug where a book subtitle didn’t appear on the title page has been fixed.
  • Column widths computed from CALS tables now specify dimensions correctly.
  • A bug related to scrolling in the on-page ToC has been fixed worked around.

And also, a special shout out to Frank Steimke for providing the inspiration for a bunch of stuff in this release, and some of the implementation, and some of the documentation! Thank you, Frank!

Share and enjoy!

XML Resolver 6.0.xhttps://so.nwalsh.com/2024/02/03-xmlresolver2024-02-03T15:20:36Z2024-02-03T15:20:36Z

The first “real” releases of XML Resolver 6.x have been published.

Volume 8, Issue 5; 03 Feb 2024

The first “real” releases of XML Resolver 6.x have been published.

It took me longer than I expected (it’s software, it always takes longer than expected), but late last week I pushed out the 6.0.0 releases of the XML Resolver for Java and C#.

Tens of hours later, we’re up to 6.0.4 on Java and 6.0.2 on C#. It’s fair to treat the 6.0.x releases as a bit “beta”. There’s only so much testing you can do before you release them in the wild. I won’t be surprised if there are few more minor revisions in short order as users try them out in their applications.

Despite my general feeling that the APIs are improved, I very quickly discovered that making them backwards incompatible

Marginal note:This should not have been a surprise, -ed.

was…painful.

Several libraries and applications that I work on blindly assume that they can instantiate an org.xmlresolver.Resolver (sometimes with reflection) and invoke methods on it. Starting in 6.0.4, I’m providing (deprecated) APIs that mimic the common 5.x APIs.

We’ll see how that goes. If you get tripped up, please let me know.

I haven’t provided the backwards compatible APIs on C# yet because I’m not sure it’s necessary. There’s less legacy for the C# APIs. But I can, if it’s a problem in the wild.

Share and enjoy!

XML Resolver refactor refactorhttps://so.nwalsh.com/2024/01/27-xmlresolver2024-01-27T18:53:04Z2024-01-27T18:53:04Z

Working on the C# implementation of the XML Resolver was instructive. It instructed me that the new design was kind of a mess and the Java implementation of that design was also…bad. So I’ve fixed that.

Volume 8, Issue 4; 27 Jan 2024

Working on the C# implementation of the XML Resolver was instructive. It instructed me that the new design was kind of a mess and the Java implementation of that design was also…bad. So I’ve fixed that.

As of sometime this afternoon, all of the unit tests for both the Java and C# versions of XML Resolver passed. That’s a big milestone; it paves the way for official “6.0.0” releases.

I’m working my way through the JavaDoc and then I’ll have to go through whatever the C# version of that is called. Then I have to turn my attention to the user documentation.

It’s awkward because a lot of things are the same, but a lot of things are different. What I’ll probably end up doing is moving the current documentation under a /legacy/ URI and making the main pages about the new version.

The new version is a substantial improvement and I want to encourage folks to migrate. At the same time, it’s probably a bit of infrastructure in your project and I’ve done that annoying thing where I’ve changed the API, so I know it’s not something everyone will want to do immediately.

The biggest user-visible change, I think, is that a bunch of different objects that implemented different APIs have all gone away. The Resolver, StAXResolver, and XercesResolver objects are no more. Most of the APIs were implemented on Resolver, but there were several different resolver objects because the various systems have incompatible APIs.

Instead, now there’s an XMLResolver object that has methods that return instances of the different APIs. That feels a lot cleaner. You can also use the XMLResolver object to interrogate the catalog or resolve resources directly, if that’s a thing you want to do.

The design is more-or-less the same now in both Java and C#. I’ve worked harder to make the C# API more C#-like (using the naming conventions expected, for example, and treating nullable with care).

Where they diverge, I think it’s because there are fundamental differences in how the Java APIs and the C# API work. Aside from the thing that’s absolutely fucking broken on C#, those differences are a matter of design. I’d have made different choices, but no one asked me.

One slightly awkward thing on C# is that my object is called XmlResolver and the system API for setting up a resolver on C# is called System.Xml.XmlResolver. That means there’s a name clash. I’ve noodled around with various ways to fix that, but I don’t really like any of them.

This means that in C# you’re going to be left doing this:

XmlReaderSettings settings = new XmlReaderSettings();
settings.XmlResolver = XmlResolver.XmlResolver.GetXmlResolver();

Which is, on the one hand, kind of ugly. But on the other hand, that’s pretty much exactly the one line of code that you need, so I’m going to see if that’s ok.

Also up next: “integration testing”. That is, will it work on SaxonJ and SaxonCS? It probably won’t work in Saxon 12.x because of the API changes, so I’ll be focusing on V.next, the-thing-that-will-eventually-be-13.0.