📄 cql-to-filter.xsl.svn-base
字号:
<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ogc="http://www.opengis.net/ogc"> <xsl:template match="/"> <ogc:Filter> <xsl:apply-templates select="*" /> </ogc:Filter> </xsl:template> <!-- ========================================================================== --> <xsl:template match="searchClause"> <xsl:choose> <xsl:when test="relation/value = '='"> <xsl:choose> <xsl:when test="contains(term, '%')"> <ogc:PropertyIsLike wildCard="%" singleChar="_" escape="\"> <ogc:PropertyName><xsl:value-of select="index" /></ogc:PropertyName> <ogc:Literal><xsl:value-of select="term" /></ogc:Literal> </ogc:PropertyIsLike> </xsl:when> <xsl:otherwise> <ogc:PropertyIsEqualTo> <ogc:PropertyName><xsl:value-of select="index" /></ogc:PropertyName> <ogc:Literal><xsl:value-of select="term" /></ogc:Literal> </ogc:PropertyIsEqualTo> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:when test="relation/value = '<>'"> <ogc:PropertyIsNotEqualTo> <ogc:PropertyName><xsl:value-of select="index" /></ogc:PropertyName> <ogc:Literal><xsl:value-of select="term" /></ogc:Literal> </ogc:PropertyIsNotEqualTo> </xsl:when> <xsl:when test="relation/value = '<'"> <ogc:PropertyIsLessThan> <ogc:PropertyName><xsl:value-of select="index" /></ogc:PropertyName> <ogc:Literal><xsl:value-of select="term" /></ogc:Literal> </ogc:PropertyIsLessThan> </xsl:when> <xsl:when test="relation/value = '<='"> <ogc:PropertyIsLessThanEqualTo> <ogc:PropertyName><xsl:value-of select="index" /></ogc:PropertyName> <ogc:Literal><xsl:value-of select="term" /></ogc:Literal> </ogc:PropertyIsLessThanEqualTo> </xsl:when> <xsl:when test="relation/value = '>'"> <ogc:PropertyIsGreaterThan> <ogc:PropertyName><xsl:value-of select="index" /></ogc:PropertyName> <ogc:Literal><xsl:value-of select="term" /></ogc:Literal> </ogc:PropertyIsGreaterThan> </xsl:when> <xsl:when test="relation/value = '>='"> <ogc:PropertyIsGreaterThanEqualTo> <ogc:PropertyName><xsl:value-of select="index" /></ogc:PropertyName> <ogc:Literal><xsl:value-of select="term" /></ogc:Literal> </ogc:PropertyIsGreaterThanEqualTo> </xsl:when> </xsl:choose> </xsl:template> <!-- ========================================================================== --> <xsl:template match="triple"> <xsl:choose> <xsl:when test="boolean/value = 'and'"> <ogc:And> <xsl:apply-templates select="leftOperand/*" /> <xsl:apply-templates select="rightOperand/*" /> </ogc:And> </xsl:when> <xsl:when test="boolean/value = 'or'"> <ogc:Or> <xsl:apply-templates select="leftOperand/*" /> <xsl:apply-templates select="rightOperand/*" /> </ogc:Or> </xsl:when> </xsl:choose> </xsl:template> <!-- ========================================================================== --> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template></xsl:stylesheet>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -