Project

Profile

Help

Bug #1632 » split.xsl

Jakub Maly, 2012-10-05 00:55

 
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0"
xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ami="urn:cz:isvs:ruian:schemas:AdrMistoIntTypy:v1"
xmlns:base="urn:cz:isvs:ruian:schemas:BaseTypy:v1"
xmlns:coi="urn:cz:isvs:ruian:schemas:CastObceIntTypy:v1"
xmlns:com="urn:cz:isvs:ruian:schemas:CommonTypy:v1"
xmlns:kui="urn:cz:isvs:ruian:schemas:KatUzIntTypy:v1"
xmlns:kri="urn:cz:isvs:ruian:schemas:KrajIntTypy:v1"
xmlns:mci="urn:cz:isvs:ruian:schemas:MomcIntTypy:v1"
xmlns:mpi="urn:cz:isvs:ruian:schemas:MopIntTypy:v1"
xmlns:obi="urn:cz:isvs:ruian:schemas:ObecIntTypy:v1"
xmlns:oki="urn:cz:isvs:ruian:schemas:OkresIntTypy:v1"
xmlns:opi="urn:cz:isvs:ruian:schemas:OrpIntTypy:v1"
xmlns:pai="urn:cz:isvs:ruian:schemas:ParcelaIntTypy:v1"
xmlns:pui="urn:cz:isvs:ruian:schemas:PouIntTypy:v1"
xmlns:rsi="urn:cz:isvs:ruian:schemas:RegSouIntiTypy:v1"
xmlns:spi="urn:cz:isvs:ruian:schemas:SpravObvIntTypy:v1"
xmlns:sti="urn:cz:isvs:ruian:schemas:StatIntTypy:v1"
xmlns:soi="urn:cz:isvs:ruian:schemas:StavObjIntTypy:v1"
xmlns:uli="urn:cz:isvs:ruian:schemas:UliceIntTypy:v1"
xmlns:vci="urn:cz:isvs:ruian:schemas:VuscIntTypy:v1"
xmlns:vf="urn:cz:isvs:ruian:schemas:VymennyFormatTypy:v1"
xmlns:zji="urn:cz:isvs:ruian:schemas:ZsjIntTypy:v1">

<xsl:output indent="yes"/>

<xsl:mode name="s" streamable="yes" />
<xsl:template name="main">
<xsl:message select="'main'"/>
<xsl:call-template name="process-ruian-file">
<xsl:with-param name="uri" select="xs:anyURI('vzorky/zastupci-full.xml')"/>
</xsl:call-template>
</xsl:template>

<xsl:template name="process-ruian-file">
<xsl:param name="uri" as="xs:anyURI"/>
<xsl:apply-templates select="doc($uri)/vf:VymennyFormat/vf:Data/*[position() lt 3]" mode="s"
/>
</xsl:template>

<!-- problem stylesheet -->
<xsl:template match="vf:*" mode="s">
<!--<xsl:variable name="collection" as="element()">
<xsl:copy>
<xsl:for-each select="./child::node()">
<xsl:copy-of select="."/>
</xsl:for-each>
</xsl:copy>
</xsl:variable>-->
<xsl:variable name="collection" as="element()">
<xsl:copy-of select="."/>
</xsl:variable>
<!--<xsl:variable name="collection" as="element()" select="current()" />-->
<!--<xsl:element name="{local-name($collection)}">
<xsl:for-each select="$collection/*">
<xsl:variable name="file" as="xs:string"
select="'split' || '/' || local-name($collection) || '/' || ./*:Kod || '.xml'"/>
<xsl:result-document href="{ $file }">
<xsl:message select="$file"/>
<xsl:sequence select="."/>
</xsl:result-document>
</xsl:for-each>
</xsl:element>-->
<xsl:copy-of select="$collection"/>
</xsl:template>

<xsl:template match="*" mode="s">
<xsl:sequence select="error((),'should never get here s')"/>
</xsl:template>
<xsl:template match="*">
<xsl:sequence select="error((),'should never get here')"/>
</xsl:template>
</xsl:stylesheet>
(4-4/4)