Здравствуйте, Sahivi, Вы писали:
S>Тут задачка такая появилась —
Может быть следующее спасет отца русской демократии?
Я делаю так, msxsl in.xml convert.xsl -o out.xml, но можно и с помощью любого другого транслятора?
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="tag1">
<Document>
<xsl:apply-templates/>
</Document>
</xsl:template>
<xsl:template match="*">
<xsl:element name="{name()}">
<xsl:apply-templates select="attribute::*" />
<xsl:apply-templates select="child::node()"/>
</xsl:element>
</xsl:template>
<xsl:template match="attribute::*">
<xsl:attribute name="{name()}">
<xsl:value-of select="." />
</xsl:attribute>
</xsl:template>
</xsl:stylesheet>