From 8dcb216648c685994e644c6ffd09482614209f0d Mon Sep 17 00:00:00 2001 From: Mark Raynsford Date: Fri, 8 Mar 2024 13:59:01 +0000 Subject: [PATCH] Fix invalid xstructural generation for named parameters. --- README-CHANGES.xml | 7 ++++- .../quarrel/ext/xstructural/QCommandXS.java | 29 +++++++------------ pom.xml | 1 + 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/README-CHANGES.xml b/README-CHANGES.xml index a009521..880e003 100644 --- a/README-CHANGES.xml +++ b/README-CHANGES.xml @@ -29,11 +29,16 @@ - + + + + + + diff --git a/com.io7m.quarrel.ext.xstructural/src/main/java/com/io7m/quarrel/ext/xstructural/QCommandXS.java b/com.io7m.quarrel.ext.xstructural/src/main/java/com/io7m/quarrel/ext/xstructural/QCommandXS.java index c427450..ba10235 100644 --- a/com.io7m.quarrel.ext.xstructural/src/main/java/com/io7m/quarrel/ext/xstructural/QCommandXS.java +++ b/com.io7m.quarrel.ext.xstructural/src/main/java/com/io7m/quarrel/ext/xstructural/QCommandXS.java @@ -190,6 +190,17 @@ private static void showCommand( sectionName(context, command, document, root); sectionDescription(context, command, document, root); + + final var named = command.onListNamedParameters(); + if (!named.isEmpty()) { + final var e = + (Element) root.appendChild( + document.createElementNS(NS_XI, "xi:include") + ); + + e.setAttribute("href", context.parameterValue(PARAMETERS_INCLUDE_NAME)); + } + sectionExamples(document, root); } case "parameters" -> { @@ -265,24 +276,6 @@ private static void sectionDescription( para.appendChild(document.createTextNode("The ")); para.appendChild(term); para.appendChild(document.createTextNode(" command... ")); - - final var named = command.onListNamedParameters(); - if (!named.isEmpty()) { - final var formal = - (Element) description.appendChild( - document.createElementNS(NS, "FormalItem") - ); - - formal.setAttribute("title", "Parameters"); - - final var e = - (Element) description.appendChild( - document.createElementNS(NS_XI, "xi:include") - ); - - e.setAttribute("href", context.parameterValue(PARAMETERS_INCLUDE_NAME)); - formal.appendChild(e); - } } private static Element parameterTable( diff --git a/pom.xml b/pom.xml index be7f265..cb23c68 100644 --- a/pom.xml +++ b/pom.xml @@ -34,6 +34,7 @@ 1.1.0 1.8.0 1.4.0 + 21 1.7.3 5.9.3