so

Parsing Markdown in XSLT

Volume 6, Issue 16; 24 Dec 2022

No, not that way. The easy way.

Recently, I wanted to construct some RSS feeds (@qt4cg, for example) from data that’s only easily available in Markdown. In principle, it would be possible (and fun!) to write a Markdown parser natively in XSLT. But I have puh-lenty of fun projects.

Instead, I took the easy way out and wrapped a Saxon extension function around a Java library that parses CommonMark, my preferred flavor.

That’s the Saxon CommonMark Processor.

Version 1.0 supports the ability to use extensions, as defined by org.commonmark. This lets you parse things like the GitHub markdown for tables and strikethrough.

Share and enjoy.

#Markdown #XSLT