aspose file tools*
The moose likes JSF and the fly likes XML namespace in a JSF 2.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "XML namespace in a JSF 2.0 " Watch "XML namespace in a JSF 2.0 " New topic
Author

XML namespace in a JSF 2.0

Enrique Villamizar
Ranch Hand

Joined: Jul 30, 2005
Posts: 93
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
Bartender

Joined: Oct 14, 2005
Posts: 18993
    
    8

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

Joined: Oct 31, 2000
Posts: 527
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?


SCJP 1.5, SCEA, ICED (287,484,486)
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16308
    
  22

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.

Customer surveys are for companies who didn't pay proper attention to begin with.
Enrique Villamizar
Ranch Hand

Joined: Jul 30, 2005
Posts: 93
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

Joined: Jun 25, 2001
Posts: 16308
    
  22

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

Joined: Jun 14, 2010
Posts: 6
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
 
subject: XML namespace in a JSF 2.0