Velocity Tools
  1. Velocity Tools
  2. VELTOOLS-152

ValidatorTool generates invalid XHTML even when in XHTML mode

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.x, 2.1
    • Component/s: VelocityStruts
    • Labels:
      None

      Description

      When using the validator tool in XHTML mode, the main "validate" method emits code like this:

      function validateMyForm(form) {
      if (bCancel)
      return true;
      else

      { var formValidationResult; formValidationResult = validateInteger(form) && validateRequired(form) && validateMaxLength(form) && validateMask(form) && validateIntRange(form); return (formValidationResult == 1); }

      Note the use of bare "&" characters, which is not valid XHTML.

      Most web browsers will ignore this little quirk unless they are in XML parsing mode (usually enabled by setting the content-type to "application/xhtml+xml").

      Here is a reference to the discussion on the user list:
      http://markmail.org/thread/jtuqduopuikwtvqm

        Activity

        Christopher Schultz made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Christopher Schultz added a comment -

        Fixed in trunk (r1381743) and 2.0.x (r1381744).

        There is a new XMLMode setting: when set to "true", ValidatorTool will use && instead of && when no CDATA wrapper-section is being used.

        Show
        Christopher Schultz added a comment - Fixed in trunk (r1381743) and 2.0.x (r1381744). There is a new XMLMode setting: when set to "true", ValidatorTool will use && instead of && when no CDATA wrapper-section is being used.
        Christopher Schultz made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Christopher Schultz added a comment -

        So, this doesn't fix the issue properly.

        What I did was essentially change '&' to '&amp', but that's not appropriate unless the page is actually in XML rendering mode, not just XHTML.

        This needs a more nuanced fix.

        Show
        Christopher Schultz added a comment - So, this doesn't fix the issue properly. What I did was essentially change '&' to '&amp', but that's not appropriate unless the page is actually in XML rendering mode, not just XHTML. This needs a more nuanced fix.
        Christopher Schultz made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.0.x [ 12315283 ]
        Fix Version/s 2.1 [ 12315969 ]
        Resolution Fixed [ 1 ]
        Hide
        Christopher Schultz added a comment -

        Fixed in trunk: r1297753
        Fixed in 2.0.x branch: r1297754

        Show
        Christopher Schultz added a comment - Fixed in trunk: r1297753 Fixed in 2.0.x branch: r1297754
        Christopher Schultz created issue -

          People

          • Assignee:
            Christopher Schultz
            Reporter:
            Christopher Schultz
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development