Cocoon
  1. Cocoon
  2. COCOON-2058

Ambiguous rule match for "fi:styling/@submit-on-change"

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.11, 2.2
    • Fix Version/s: 2.1.12, 2.2
    • Component/s: Blocks: Forms
    • Labels:
      None
    • Affects version (Component):
      Blocks: Forms - 1.0.0-RC2
    • Fix version (Component):
      Blocks: Forms - 1.0.0-RC3-SNAPSHOT

      Description

      Ambiguous rule match for "fi:styling/@submit-on-change" between "fi:styling/@submit-on-change" and "fi:styling/@*" in forms-field-styling.xsl rules when using Saxon. Priority of "fi:styling/@submit-on-change" should be set to 1 (as in the "fi:styling/@type" rule).

      --- Starting at line 151 of forms-field-styling.xsl ---


        <xsl:template match="fi:styling/@*" mode="styling">
          <xsl:copy-of select="."/>
        </xsl:template>

        <xsl:template match="fi:styling/@submit-on-change" mode="styling">
          <xsl:if test=". = 'true'">
            <xsl:attribute name="onchange">forms_submitForm(this)</xsl:attribute>
          </xsl:if>
        </xsl:template>

        <xsl:template match="fi:styling/@list-type | fi:styling/@list-orientation |
                             fi:styling/@listbox-size | fi:styling/@format | fi:styling/@layout"
                      mode="styling">
          <!--+
              | Ignore marker attributes so they don't go into the resuling HTML.
              +-->
        </xsl:template>

        <xsl:template match="fi:styling/@type" mode="styling" priority="1">
          <!--+
              | Do we have a duplicate semantic usage of @type?
              | @type is only a marker for the stylesheet in general, but some of the
              | types must/should be in the HTML output too.
              +-->
          <xsl:variable name="validHTMLTypes"
                        select="'text hidden checkbox radio password image reset submit'"/>
          <xsl:if test="normalize-space(.) and
                        contains(concat(' ', $validHTMLTypes, ' '), concat(' ', ., ' '))">
            <xsl:copy-of select="."/>
          </xsl:if>
        </xsl:template>

        Activity

        Hide
        Antonio Gallardo added a comment -
        Would you post saxon error message?
        Show
        Antonio Gallardo added a comment - Would you post saxon error message?
        Hide
        Jörg Heinicke added a comment -
        I think, you can add the priority attribute as Ralph wrote safely, Antonio. You should also add it to the other template matching on "fi:styling/@list-type | fi:styling/@list-orientation | ..." That one will probably be the next for which Saxon fails.
        Show
        Jörg Heinicke added a comment - I think, you can add the priority attribute as Ralph wrote safely, Antonio. You should also add it to the other template matching on "fi:styling/@list-type | fi:styling/@list-orientation | ..." That one will probably be the next for which Saxon fails.
        Hide
        Antonio Gallardo added a comment -
        I am wondering if is a good idea to add priorities to xslt rules for the default cform rendering. I am thinking for the users that overwrote this rules. wdyt?
        Show
        Antonio Gallardo added a comment - I am wondering if is a good idea to add priorities to xslt rules for the default cform rendering. I am thinking for the users that overwrote this rules. wdyt?
        Hide
        Antonio Gallardo added a comment -
        This issue is a cforms issue.
        Show
        Antonio Gallardo added a comment - This issue is a cforms issue.
        Hide
        Jörg Heinicke added a comment -
        Also found this thread: http://marc.info/?t=115979449700002&r=1&w=4.

        Eventually running into this issue myself ... Saxon weights "fi:styling/@*" the same as "fi:styling/@name" (exact attribute name). I consider this behavior of Saxon rather annoying ...
        Show
        Jörg Heinicke added a comment - Also found this thread: http://marc.info/?t=115979449700002&r=1&w=4 . Eventually running into this issue myself ... Saxon weights "fi:styling/@*" the same as "fi:styling/@name" (exact attribute name). I consider this behavior of Saxon rather annoying ...

          People

          • Assignee:
            Jörg Heinicke
            Reporter:
            Ralph Collett
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development