<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">


<xsl:output method="text" /> 
<xsl:template match="/">
<xsl:comment>
    Kontakt: Rafal Swiderski, gonzak(at)op(dot)pl 
    Konwerter do formatu SQL bazy z GUS XML
    Do skryptu nalezy zalozyc tabelke ktora bedzie zawierala odpowiednie pola, Ten plik generuje tylko same inserty   
</xsl:comment>

<xsl:for-each select="teryt/catalog/row">
INSERT INTO miasta ( <xsl:for-each select="col"><xsl:value-of select="@name" /><xsl:if test="position()!=last()">, </xsl:if></xsl:for-each>) VALUES (<xsl:for-each select="col">"<xsl:value-of select="." />"<xsl:if test="position()!=last()">, </xsl:if></xsl:for-each>);</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
