SourceCode/PROMS/fmtxml/TranslatePAG.XSL
2012-04-03 16:18:04 +00:00

63 lines
2.2 KiB
Plaintext

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="PageStyles">
<PageStyles>
<xsl:attribute name="Name"><xsl:value-of select="./Name"/></xsl:attribute>
<xsl:apply-templates/>
</PageStyles>
</xsl:template>
<xsl:template match="PgStyles">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="PageStyle">
<PageStyle>
<xsl:attribute name="Name"><xsl:value-of select="./Name"/></xsl:attribute>
<xsl:attribute name="Index"><xsl:value-of select="./Index"/></xsl:attribute>
<xsl:apply-templates/>
</PageStyle>
</xsl:template>
<xsl:template match="Items">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="PSItem">
<Item>
<xsl:attribute name="Token"><xsl:value-of select="./Token"/></xsl:attribute>
<xsl:attribute name="Row"><xsl:value-of select="./Row"/></xsl:attribute>
<xsl:attribute name="Col"><xsl:value-of select="./Col"/></xsl:attribute>
<xsl:attribute name="Justify"><xsl:value-of select="./Justify"/></xsl:attribute>
<xsl:apply-templates/>
</Item>
</xsl:template>
<xsl:template match="Style">
<xsl:if test="string-length(./FontFamily)+string-length(./FontSize)+string-length(./FontStyle)>0">
<Font>
<xsl:if test="string-length(./FontFamily)">
<xsl:attribute name="Family">
<xsl:value-of select="./FontFamily"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="string-length(./FontSize)">
<xsl:attribute name="Size">
<xsl:value-of select="./FontSize"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="string-length(./FontStyle)">
<xsl:attribute name="Style">
<xsl:value-of select="./FontStyle"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="string-length(./CPI)">
<xsl:attribute name="CPI">
<xsl:value-of select="./CPI"/>
</xsl:attribute>
</xsl:if>
</Font>
</xsl:if>
</xsl:template>
<xsl:template match="text()"/>
</xsl:stylesheet>