File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML namespace in a JSF 2.0

 
Enrique Villamizar
Ranch Hand
Posts: 93
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody:

When I run a JSF 2.0 application (*.xhtml files) the following warning messages appear:


Anyway the application works well.
What should I do for preventing these messages to the users?
 
Paul Clapham
Sheriff
Pie
Posts: 20202
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This looks a lot like the question is specific to JSF and not much like it's specific to XML. Moving...
 
Anil Vupputuri
Ranch Hand
Posts: 527
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Enrique Villamizar wrote:
When I run a JSF 2.0 application (*.xhtml files) the following warning messages appear:



Could you post contents of DOCTYPE tag?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17639
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're failing XML validation by referencing a namespace that wasn't declared.

You need something like the following:


Except in your case, you need an xmlns that defines the "hr" and "li" namespaces.
 
Enrique Villamizar
Ranch Hand
Posts: 93
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Tim and thanks for your reply.

Anil, my doctype declaration is:


To be honest I don't understand why I should have a namespace declaration for any xhtml tag I used in the view pages.

What do I need to change or add to the doctype declaration in order to solve the problem?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17639
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Enrique Villamizar wrote:Hello Tim and thanks for your reply.

Anil, my doctype declaration is:


To be honest I don't understand why I should have a namespace declaration for any xhtml tag I used in the view pages.

What do I need to change or add to the doctype declaration in order to solve the problem?


You have to have a namespace declaration because the page is being processed by a validating XML parser. A validating parser (and most of the major ones DO validate by default) requires that each and every element and attribute and their relationships must be defined, either in an XML DTD or an XML schema. Which DTD/schema is applied to a given element is dependent on what namespace that element (or attribute) resides in. You map that using an xmlns reference, which pairs a namespace ID with a logical schema name.

Since you hadn't defined the li or hr namespaces, any tags or attributes relative to those namespaces failed to validate for lack of a validation reference.
 
sarad saradh
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I have related problem. I am using netbeans 6.8 and JSF 2.0 .

<html xmlns:fb="http://www.facebook.com/2008/fbml">

I am getting "No library found for this namespace" error in the above mentioned code. If I try to run it I get the following message

Warning: This page calls for XML namespace http://www.facebook.com/2008/fbml declared with prefix fb but no taglibrary exists for that namespace

The code is and runs ok in .jsp or .html files. It is a problem only when I use it with .xhtml file.

Any direction please
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic