Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > comp.text.xml > #863

Re: xml condition

From Peter Flynn <peter@silmaril.ie>
Newsgroups comp.text.xml
Subject Re: xml condition
Date 2016-04-16 23:53 +0100
Message-ID <dnfu2nF1us7U1@mid.individual.net> (permalink)
References <b2a435fd-9d7d-4b0c-965e-28b8f1cf6137@googlegroups.com>

Show all headers | View raw


On 04/15/2016 06:08 PM, today wrote:
> Is any better way to express this condition 

Yes. Use XPath in a language like XSLT2.

> which is to detect words in a table that have some ending, group them
> together in a class

You mean change their position in the output?

> and colorize the columns in a particular color and highlight the
> lines that fall under the condition.

You must post some sample data that this can be tested on. It is
impossible to understand your example, because we cannot see the
input, and your condition elements are not referred to in your results,
so it is impossible to see which of them is being applied.

> <IF>
>     <CONDITIONS>
>             <condition col="x" line="2" operator="and" line="4" TextEnd="e"></condition>
>             <condition col="x" line="5" operator="and" line="6" TextEnd="a"></condition>
>             <condition col="x" line="10" TextEnd="er"></condition>
>  </CONDITIONS>

If I understand this right,

<xsl:template match="something which matches lines 2 and 4 and col x">
  <xsl:choose>
    <xsl:when test="ends-with(.,'e') or
                    ends-with(.,'a') or
                    ends-with(.,'er')">
     -- do something --
    </xsl:when>
    <xsl:otherwise>
     -- do something else --
    </xsl:otherwise>
</xsl:template>

But you need to provide us with a LOT more information.

///Peter
-- 
XML FAQ: http://xml.silmaril.ie/

Back to comp.text.xml | Previous | NextPrevious in thread | Find similar


Thread

xml condition today <houda.araj@gmail.com> - 2016-04-15 10:08 -0700
  Re: xml condition Peter Flynn <peter@silmaril.ie> - 2016-04-16 23:53 +0100

csiph-web