• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Error:The XML page cannot be displayed Cannot view XML input using style sheet

 
Ranch Hand
Posts: 47
Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a templatepage.xhtml



and my index page is

<html>
<head> </head>
<body>
<%-- <jsp:forward page="faces/ICEfacesPage1.xhtml" /> --%>
<jsp:forward page="faces/templatepage.xhtml" />
</body>
</html>

contents of ICEfacesPage1.xhtml



When i run the application i get following error.

The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.


--------------------------------------------------------------------------------

Cannot have multiple DOCTYPE declarations. Error processing resource 'http://localhost:8080/test/'. Line 3, Position 11

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&...


I set the ie security settings Internet options -> Security, you'll see an option
"access data sources across domains".
as mentioned in a post http://in.answers.yahoo.com/question/index?qid=20060812193550AAv5emQ
But it did not work.

Please suggest me what could be possible fixes.
 
bilal haider
Ranch Hand
Posts: 47
Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I add

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> in templatepage.xhtml

a file is generated with the name of project containing the code written in templatepage.xhtml. Image Attached

and if I remove

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

from all the xhtml page. and leave only in headerpage.xhtml it shows the right behavior.

I am unable to understand this phenomena.
message.JPG
[Thumbnail for message.JPG]
ScreenShot
 
Saloon Keeper
Posts: 24499
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JSF doesn't work with HTML (or xhtml). It works with JSF View templates. Depending on how things are set up, JSF may generate HTML or XHTML, but one of the advantages of JSF is that the renderers are plug-replaceable components. You could just as easily render a PDF.

The confusion here is because ".xhtml" is the popular file extension for Facelets templates, but Facelets templates aren't (X)HTML, they're JSF XML.

The Facelets renderer is generating an XHTML doctype and you're providing one manually, and that's one more DOCTYPE than the web browser wants to see.
 
bilal haider
Ranch Hand
Posts: 47
Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you tim for the reply .

I only got this .
The Facelets renderer is generating an XHTML doctype and you're providing one manually, and that's one more DOCTYPE than the web browser wants to see.


Other points have gone over my head.

I removed all the the doctype line and added



in web.xml

and problem is fixed. But i am interested to understand other points as well. i am new to jsf,icefacses.
 
Tim Holloway
Saloon Keeper
Posts: 24499
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A lot of what I say goes over people's heads. Don't worry about it, as long as you get your problem solved.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic