Hi all, I need your appreciated help.
If export in XML my table MySQL I have only for this fields this situation:
Enà_Cod, in XML output is `c3`
`DurN (sec)`, in XML output is `c20`
`DurS (sec)`, in XML output is `c23`
`DurT (sec)`, in XML output is `c28`
`DurO (sec)`, in XML output is `c26`
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:rs="urn:schemas-microsoft-com:rowset"
xmlns:z="#RowsetSchema">
<xsl:output omit-xml-declaration="yes"/>
<xsl:template match="/">
<!-- show a header by looking Schema element -->
<xsl:for-each select="/xml/s:Schema/s:ElementType/s:AttributeType">
<xsl:value-of select="@name"/>
<xsl:choose>
<xsl:when test="position()!=last()">
<!-- xls -->
<xsl:text>	</xsl:text>
<!-- csv -->
<!--xsl:text>,</xsl:text-->
</xsl:when>
<xsl:otherwise>
<xsl:text>
</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<!-- row data -->
<xsl:for-each select="/xml/rs:data/z:row">
<xsl:variable name="row" select="."/>
<!-- for each column -->
<xsl:for-each select="/xml/s:Schema/s:ElementType/s:AttributeType">
<!-- display each column if it exists -->
<xsl:variable name="columnName" select="@name"/>
<!-- go through all columns and display something that matches-->
<!--xsl:value-of select="$row/@*[name()=$columnName]"/-->
<xsl:value-of select="translate($row/@*[name()=$columnName],'.',',')" />
<xsl:if test="position()!=last()">
<!-- xls -->
<xsl:text>	</xsl:text>
<!-- csv -->
<!--xsl:text>,</xsl:text-->
</xsl:if>
</xsl:for-each>
<xsl:text>
</xsl:text>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Why?
Thanks in advance.
Cheers