• xml condition

    From Peter Flynn@21:1/5 to today on Sat Apr 16 23:53:11 2016
    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.


    <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/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From today@21:1/5 to All on Fri Apr 15 10:08:01 2016
    Is any better way to express this condition which is to detect words in a table that have some ending, group them together in a class and colorize the columns in a particular color and highlight the lines that fall under the condition.
    Thanks in advance


    <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>
    <RESULTS><Create Class1/></RESULTS>
    <ELSE>
    <RESULTS><Color="class1" color="Blue"/></RESULTS>
    </ELSE>
    <ELSE>
    <RESULTS><Color="lines" highlight color="NavyBlue"/></RESULTS>
    </ELSE>
    </IF>



    <CONDITIONS>
    <condition col="x" line="2" operator="and" line="4" TextEnd="e"></condition>
    <condition col="x" line="5" operator="and" line="6" operator="and" line="11" TextEnd="i"></condition>
    <condition col="x" line="10" TextEnd="er"></condition>
    </CONDITIONS>
    <RESULTS><Create Class2/></RESULTS>
    <ELSE>
    <RESULTS><Color="class2" color="Blue"/></RESULTS>
    </ELSE>
    <ELSE>
    <RESULTS><Color="lines" highlight color="NavyBlue"/></RESULTS>
    </ELSE>
    </IF>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)