1 Reply Latest reply on Apr 23, 2008 3:30 PM by ssilvert

    org.w3c.dom.DOMException: INVALID_CHARACTER_ERR

    westenb

      Hello,

      when starting using JSFUnit I experienced a few strange problems in my setup consisting of
      - Java 1.5
      - JSF 1.2
      - Facelets 1.1
      - JSFUnit 1.0-beta-1

      When using an XML jspx file for my surrounding template, I always get the follwing exception when creating the JSFClientSesssion

      java.lang.RuntimeException: javax.xml.transform.TransformerException: org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified.
      at org.jboss.jsfunit.facade.JSFClientSession.doWebRequest(JSFClientSession.java:193)
      at org.jboss.jsfunit.facade.JSFClientSession.doInitialRequest(JSFClientSession.java:122)
      at org.jboss.jsfunit.facade.JSFClientSession.(JSFClientSession.java:75)
      at com.test.eric.registration.jsfunit.FormJsfUnitTest.setUp(FormJsfUnitTest.java:28)

      The header of my template looks as follows
      <?xml version="1.0" encoding="UTF-8"?>
      <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      version="2.0">

      [...]

      When I change this header to
      <!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">
      [...]

      it is working fine. Please note that both applications are working fine outside my JSFUnit test environment (at least on Firefox2 and IE7).

      Any idea what is causing this problem? Is there any "best practise" guide regarding .jspx file layout.

      Regards,
      Eric