From 737c51f2a536c85bae71e3da32d07870b1c0833d Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Mon, 9 Oct 2023 17:46:49 +1100 Subject: [PATCH] Fix rendering of XML Attributes in profiles --- .../r5/renderers/StructureDefinitionRenderer.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureDefinitionRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureDefinitionRenderer.java index 7c21255ff..845dc8314 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureDefinitionRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureDefinitionRenderer.java @@ -848,8 +848,16 @@ public class StructureDefinitionRenderer extends ResourceRenderer { if (element.hasSliceName()) sName = sName +":"+element.getSliceName(); used.used = true; - if (logicalModel && element.hasRepresentation(PropertyRepresentation.XMLATTR)) - sName = "@"+sName; + if (logicalModel) { + if (element.hasRepresentation(PropertyRepresentation.XMLATTR)) { + sName = "@"+sName; + } else if (element.hasUserData("derived.pointer")) { + ElementDefinition drv = (ElementDefinition) element.getUserData("derived.pointer"); + if (drv.hasRepresentation(PropertyRepresentation.XMLATTR)) { + sName = "@"+sName; + } + } + } Cell nc = genElementNameCell(gen, element, profileBaseFileName, snapshot, corePath, imagePath, root, logicalModel, allInvariants, profile, typesRow, row, hasDef, ext, used, ref, sName, all); switch (context.getStructureMode()) { case BINDINGS: