1 Reply Latest reply on Apr 24, 2008 8:07 PM by nbelaevski

    XML error for IE 6.x

    schradermj11

      A small number of users to one of my sites using JSF, RichFaces, and Facelets is getting an XML error.

      The XML page cannot be displayed
      Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
      
      Whitespace is not allowed at this location. Error processing resource 'http://www.musclesafari.com/MuscleSafari'. Line 65,...
      <script type="text/javascript" language="Javascript">function dpf(f) {var adp = f.adp;if (adp != null) {for (var i = 0...


      The full line 65 is as follows

      <script type="text/javascript" language="Javascript">function dpf(f) {var adp = f.adp;if (adp != null) {for (var i = 0;i < adp.length;i++) {f.removeChild(adp);}}};function apf(f, pvp) {var adp = new Array();f.adp = adp;var ps = pvp.split(',');for (var i = 0,ii = 0;i < ps.length;i++,ii++) {var p = document.createElement("input");p.type = "hidden";p.name = ps;p.value = ps[i + 1];f.appendChild(p);adp[ii] = p;i += 1;}};function jsfcljs(f, pvp, t) {apf(f, pvp);var ft = f.target;if (t) {f.target = t;}f.submit();f.target = ft;dpf(f);};</script>


      This is injected into the code I'm assuming by RichFaces? Is there a configuration I might be missing, or have I found a bug?

        • 1. Re: XML error for IE 6.x
          nbelaevski

          Hello,

          The script you've mentioned is a standard JSF command link component script. I've visited your site and then reproduced the problem locally. Please compare:

          <?xml version="1.0" encoding="UTF-8"?>
          
          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
          
          <!--
           Document : main_layout
           Created on : Apr 11, 2008, 8:08:08 PM
           Author : SchraderMJ11
          -->
          
          <html xmlns="http://www.w3.org/1999/xhtml"
           xmlns:ui="http://java.sun.com/jsf/facelets"
           xmlns:h="http://java.sun.com/jsf/html"
           xmlns:f="http://java.sun.com/jsf/core"
           xmlns:a4j="http://richfaces.org/a4j"
           xmlns:rich="http://richfaces.org/rich">
          fails

          <?xml version="1.0" encoding="UTF-8"?>
          
          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
          
          <html xmlns="http://www.w3.org/1999/xhtml"
           xmlns:ui="http://java.sun.com/jsf/facelets"
           xmlns:h="http://java.sun.com/jsf/html"
           xmlns:f="http://java.sun.com/jsf/core"
           xmlns:a4j="http://richfaces.org/a4j"
           xmlns:rich="http://richfaces.org/rich">
          <!--
           Document : main_layout
           Created on : Apr 11, 2008, 8:08:08 PM
           Author : SchraderMJ11
          -->
          works ok

          You should use the second variant (i.e. comment nodes should go after the first element, but not before it)