以下是我需要转换的原始 XML 文件。作为输出,我需要显示每个触发器每个小部件的可用动画效果。就像 Widet 类型全部和触发器类型显示我需要的所有效果,如 1、3、6、9。
<?xml version="1.0" encoding="utf-8"?>
<InputAnimationConfigurationSchema>
<ConfigurationEffects>
<AEffect Id="1" DisplayName="A Effect">
</AEffect>
<BEffect Id="2" DisplayName="B Effect">
</BEffect>
<CEffect Id="3" DisplayName="C Effect">
</CEffect>
<DEffect Id="4" DisplayName="D effect">
</DEffect>
<EEffect Id="5" DisplayName="E effect">
</EEffect>
<FEffect Id="6" DisplayName="F effect">
</FEffect>
<GEffect Id="7" DisplayName="G effect">
</GEffect>
<HEffect Id="8" DisplayName="H effect">
</HEffect>
<IEffect Id="9" DisplayName="I effect">
</IEffect>
<JEffect Id="10" DisplayName="J effect">
</JEffect>
<KEffect Id="11" DisplayName="K effect">
</HEffect>
<LEffect Id="12" DisplayName="L effect">
</KEffect>
</ConfigurationEffects>
<ConfigurationMappings>
<ConfigurationMap>
<Widget Type="All" Include="true" NeedsMandatoryEffectConfiguration="true"/>
<Trigger Type="Show" />
<ConfigurationEffects>
<Effect>1</Effect>
<Effect>2</Effect>
<Effect>3</Effect>
<Effect>9</Effect>
</ConfigurationEffects>
</ConfigurationMap>
<ConfigurationMap>
<Widget Type="All" Include="true" NeedsMandatoryEffectConfiguration="true"/>
<Trigger Type="Hide" />
<ConfigurationEffects>
<Effect>1</Effect>
<Effect>2</Effect>
<Effect>3</Effect>
<Effect>9</Effect>
</ConfigurationEffects>
</ConfigurationMap>
<ConfigurationMap>
<Widget Type="PlaceHolder" Include="false" NeedsMandatoryEffectConfiguration="true"/>
</ConfigurationMap>
<ConfigurationMap>
<Widget Type="PosterItem" Include="false" NeedsMandatoryEffectConfiguration="true"/>
</ConfigurationMap>
</ConfigurationMappings>
</InputAnimationConfigurationSchema>
我得到以下格式的输出:
All Show A Effect
--------------------------
All Show C Effect
--------------------------
All Show F Effect
-------------------------
All Show I Effect
----------------------------
All Hide A Effect
---------------------------
All Hide C Effect
--------------------------
All Hide F Effect
----------------------------
但我想以以下格式显示输出:
All Show A Effect
--------------------------
All Show C Effect
--------------------------
All Show F Effect
-------------------------
All Show I Effect
----------------------------
All Hide A Effect
---------------------------
All Hide C Effect
--------------------------
All Hide F Effect
----------------------------
PlaceHolder ---------------------------- 海报项目
我正在寻找的是,如果小部件不包含任何触发器和效果,那么它们也应该显示带有空值的小部件。如果有人能给我一些执行此任务的指示,将不胜感激
stuartLC 给出的 xsl 代码是我开始工作的基础,但为了显示占位符和后项而卡在这里