Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <xsl:transform version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- >
- <!-- merge sibling elements, maybe separated with blankspace nodes -->
- <xsl:template match="*">
- <xsl:copy><xsl:copy-of select="@*"/><xsl:apply-templates/></xsl:copy>
- </xsl:template>
- <xsl:template match="text()[not( normalize-space() )]" mode="greek"/>
- <xsl:template match="text()[not( normalize-space() )][ following-sibling::node()[self::spoj] ]" mode="greek">
- <xsl:text> </xsl:text>
- </xsl:template>
- <xsl:template match="spoj" mode="greek">
- <xsl:apply-templates/>
- </xsl:template>
- <xsl:template match="defpozn">
- <comment><xsl:copy-of select="@*"/>
- <xsl:copy-of select="node()[1][self::text()]"/>
- <xsl:if test="spoj">
- <expression>
- <xsl:apply-templates select=" spoj[1] | spoj[1]/following-sibling::node()" mode="greek"/>
- </expression>
- </xsl:if>
- </comment>
- </xsl:template>
- <xsl:template match="defpozn[ *[ not(self::spoj)] ] | defpozn[ spoj[1]/following-sibling::text()[ normalize-space() ] ] ">
- <xsl:message terminate="yes">
- <xsl:text>Not supported:</xsl:text>
- <xsl:copy-of select="."/>
- </xsl:message>
- </xsl:template>
- <xsl:output
- encoding="UTF-8"
- indent="yes"
- method="xml"
- />
- </xsl:transform>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement