Ich fange gerade mit xsl an. Ich werde unten beschreiben, was ich zu erreichen versuche und hoffe, dass jemand helfen kann.Besuchsknoten in xsl
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns1:GetSkillResponse>
<ns1:Skill>
<ns1:Person>
<ns1:SkillId>001</ns1:SkillId>
</ns1:Person>
<ns1:Task Active="N">Value 1</ns1:Task>
<ns1:Task Active="Y">Value 2</ns1:Task>
<ns1:Task Active="Y">Value 3</ns1:Task>
</ns1:Skill>
<ns1:Skill>
<ns1:Person>
<ns1:SkillId>002</ns1:SkillId>
</ns1:Person>
<ns1:Task Active="Y">Value 1</ns1:Task>
<ns1:Task Active="Y">Value 2</ns1:Task>
<ns1:Task Active="Y">Value 3</ns1:Task>
</ns1:Skill>
</ns1:GetSkillResponse>
<?xml version="1.0" encoding="UTF-16"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:ns1="http://test">
<xsl:template name="GetSkillResponse">
<Message>
<xsl:for-each select="/ns1:GetSkillResponse/ns1:Skill">
<PropertySet>
<xsl:attribute name="MySkillId"><xsl:value-of select="ns1:Person/ns1:SkillId"/></xsl:attribute>
<xsl:attribute name="MyTask"><xsl:value-of select="ns1:Task"/></xsl:attribute>
<xsl:attribute name="MyActiveFlag"><xsl:value-of select="ns1:Task/@Active"/></xsl:attribute>
</PropertySet>
</xsl:for-each>
</Message>
</xsl:template>
</xsl:stylesheet>
Das bekommt mir:
001, 1 Wert, N
002, Wert 1, Y
Aber ich brauche zu bekommen:
001, Wert 1, N
001, Wert 2, Y
001, Wert 3, Y
002, Wert 1, Y
002, Wert 2, Y
00 2, Wert 3, Y
Ist das möglich?
Vielen Dank vereinfachen können, ist dies genau das, was ich brauchte. – Paul