summaryrefslogtreecommitdiffstats
path: root/examples/corelib/serialization/cbordump/tag-transform.xslt
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2023-03-28 15:09:37 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2023-05-02 17:03:26 +0200
commit55fe3ee5e784d9d128ffa41b03bcd86e10b41357 (patch)
tree439a47a1d4cfa388b1fb08589a31f4f19b016fba /examples/corelib/serialization/cbordump/tag-transform.xslt
parent4fcb348154b72146b91049ea252575054b87806a (diff)
Replace runic XSLT with a python script and tidy cbordump code
Filters records on having value < 256, or an RFC, previously hacked into the XSLT to produce the last update, with a bit of hand-editing. Using a python script makes it easier to control the formatting and other details; for example, severl entries previously had descriptions that mentioned their RFC, with specific section, to which the XSLT was adding a redundant mention of the RFC. It is also possible to exploit C++ string juxtaposition to get tidily-presented string literals, without having to resort to raw strings. Task-number: QTBUG-111228 Change-Id: Ibd1c93dc1c88689e78b2b13a6bcb59a003f4df0f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'examples/corelib/serialization/cbordump/tag-transform.xslt')
-rw-r--r--examples/corelib/serialization/cbordump/tag-transform.xslt28
1 files changed, 0 insertions, 28 deletions
diff --git a/examples/corelib/serialization/cbordump/tag-transform.xslt b/examples/corelib/serialization/cbordump/tag-transform.xslt
deleted file mode 100644
index fb9f81df33..0000000000
--- a/examples/corelib/serialization/cbordump/tag-transform.xslt
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:a="http://www.iana.org/assignments" version="1.0">
-<xsl:output omit-xml-declaration="yes" indent="no" method="text"/>
-<xsl:template match="/a:registry[@id='cbor-tags']">struct CborTagDescription
-{
- QCborTag tag;
- const char *description; // with space and parentheses
-};
-
-// <xsl:value-of select="a:registry/a:title"/>
-static const CborTagDescription tagDescriptions[] = {
- // from https://www.iana.org/assignments/cbor-tags/cbor-tags.xhtml
-<xsl:for-each select="a:registry/a:record">
- <xsl:sort select="a:value" data-type="number"/>
- <xsl:if test="a:semantics != ''">
- <xsl:call-template name="row"/>
- </xsl:if>
- </xsl:for-each> { QCborTag(-1), nullptr }
-};
-</xsl:template>
-<xsl:template name="row"> { QCborTag(<xsl:value-of select="a:value"/>),
- R"r( (<xsl:value-of select="a:semantics"/> <xsl:call-template name="xref"/>))r" },
-</xsl:template><!-- fn:replace(a:semantics, '\s+', ' ') -->
-<xsl:template name="xref"><xsl:if test="a:xref/@type = 'rfc'"> [<xsl:value-of
-select="translate(a:xref/@data,'rfc','RFC')"/>]</xsl:if>
-</xsl:template>
-</xsl:stylesheet>