Transformación del par de valores de nombre XSL
No estoy seguro de que sea posible, pero aquí va.
De este XML:
<?xml version="1.0" encoding="UTF-8"?>
<AttributesCollection>
<Attributes>
<AttributeName>AAA</AttributeName>
<AttributeValue>Value1</AttributeValue>
</Attributes>
<Attributes>
<AttributeName>BBB</AttributeName>
<AttributeValue>Value2</AttributeValue>
</Attributes>
</AttributesCollection>
Estoy buscando convertirlo a lo siguiente usando la transformación XSL:
<Attributes>
<AAA>Value1</AAA>
<BBB>Value2</BBB>
</Attributes>
Puedo obtener los nombres de los atributos, pero no estoy seguro de cómo configurar el XML. Esto es lo que he intentado.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:for-each select="./AttributesCollection/Attributes/AttributeName">
Name:<xsl:value-of select="."/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Que me dan
<?xml version="1.0" encoding="UTF-8"?>
Name:AAA
Name:BBB
Entonces, ¿es posible hacer lo que estoy buscando? ¿Alguna ayuda? Gracias