Skip to content

Commit 23ee254

Browse files
committed
Allow accessing the refkey in the data transformer.
1 parent 64a857b commit 23ee254

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

StructuredXmlEditor/Data/DataTransformer.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
using StructuredXmlEditor.Definition;
2+
using System;
23
using System.Collections.Generic;
34
using System.Linq;
45
using System.Text;
@@ -174,6 +175,10 @@ public IEnumerable<XElement> TransformElement(XElement root, XElement originalEl
174175
variableValue = targetEl.Value;
175176
}
176177
}
178+
else if (variableSplit[2] == "refkey")
179+
{
180+
variableValue = targetEl.Attribute(DataDefinition.MetaNS + "RefKey").Value;
181+
}
177182
else if (!string.IsNullOrWhiteSpace(variableSplit[2]))
178183
{
179184
throw new Exception("Unknown variable part type '" + variableSplit[2] + "'!");

StructuredXmlEditor/View/CustomControls/DataTransformerToolView.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
<TextBlock
9393
Grid.Row="2"
9494
Margin="5,5,5,0"
95-
Text="Replace template. Access content with {(el,root) | (path) | (contents,name)}." />
95+
Text="Replace template. Access content with {(el,root) | (path) | (contents,name,refkey)}." />
9696
<local:PromptTextBox
9797
Grid.Row="3"
9898
AcceptsReturn="True"

0 commit comments

Comments
 (0)