• Resolved FredrikKindahl

    (@fredrikkindahl)


    I’m listing a bunch of products and if the productType differs from the previous row then it writes out an extra row with the new productType

    <xsl:if test="productType != preceding-sibling::product[1]/productType">
    	new tablerow containing <xsl:copy-of select="productType"/>
    </xsl:if>

    But this doesn′t write out the productType for the first row, so then i thought I start with one of these…

    <xsl:if test="position()=first()">
    	new tablerow containing <xsl:copy-of select="productType"/>
    </xsl:if>

    But this is causing following error

    Warning: XSLTProcessor::transformToXml() [xsltprocessor.transformtoxml]: xmlXPathCompOpEval:
    function first not found in /storage/content…..

    I am using <?xml version=”1.0″ encoding=”UTF-8″ ?>
    <xsl:stylesheet xmlns:xsl=”https://www.w3.org/1999/XSL/Transform&#8221; version=”1.0″> can this

Viewing 1 replies (of 1 total)
  • Thread Starter FredrikKindahl

    (@fredrikkindahl)

    Ok, i dont’t know why, but when i tried
    <xsl:if test="position()=1">
    instead of
    <xsl:if test="position()=first()">
    it works fine ??

Viewing 1 replies (of 1 total)
  • The topic ‘xsl – position first not found’ is closed to new replies.