以下是我需要轉換的原始XML文件。作爲輸出,我需要爲每個觸發器顯示每個控件的可用動畫效果。類似於所有觸發器類型和觸發器類型顯示我需要的所有效果, 3,6,9。XML到HTML轉換
<?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
----------------------------
佔位符 ----- ----------------------- PosterItem
我在看的是如果小部件不包含任何觸發器和效果,那麼他們也應該顯示帶有空值的小部件。將不勝感激,如果有人可以給我一些指點執行此任務
通過stuartLC給出的XSL代碼是基本我承擔了,我開始工作,但這裏仍然呆在那裏顯示佔位符和posteritem
還有,你對SO再次發佈您的問題之前試過嗎? –
我已經添加了我嘗試寫入的xsl代碼。它顯示輸出爲全部,顯示,但是我試圖代替所有顯示1,它應該顯示特定ID的效果名稱。 –
您的xml格式不正確 - 它有2個根元素(ConfigurationEffects和ConfigurationMappings,KEffect和LEffect沒有正確關閉) – StuartLC